Azure / Azure/Azurite

A Node.js/JavaScript API

Open
#540 1 comment 0 reactions 1 assignee Claimed by @blueww View on GitHub
enhancement featureparity NewArch
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

First: thanks for this project. It works extremely well for all my purposes (except one).

### Which service(blob, file, queue, table) does this issue concern?
All services

### Which version of the Azurite was used?
3.8.0

### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
npm

### What's the Node.js version?
12.18.0

### What problem was encountered?
Can not require Azurite in a Node.js context.

### Steps to reproduce the issue?
Create a file `azurite-require.js` with the following content.

```js
require('azurite');
```

Run the file with `node`.

```bash
node azurite-require
```

Observe the error message.

> Error: Cannot find module 'vscode'

### Have you found a mitigation/solution?
Yes, but it's not very ergonomic. This is a stripped down version of what I currently use.

```js
const { spawn } = require('child_process');
const path = require('path');

spawn(
'azurite',
['-s', '-l', './azurite-storage', './azurite-storage/debug.log'],
{
cwd: path.resolve(__dirname, '..'),
shell: true,
stdio: 'inherit',
}
);
```

### Wanted behavior
I would like Azurite to be requirable in Node.js so that I can run it as a part of other scripts.

Being "Based on Node.js" and distributed on npm, I expected this to be the case (I'm really not trying to sound entitled here). The current solution doesn't feel very good, and it would be very nice to have an official JavaScript API to more easily be able to run Azurite with other services (I'm currently using Azure Functions Core Tools, Azurite, Browsersync, and Webpack together to develop Azure Functions locally).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.