Azure / Azure/azure-functions-core-tools
A Node.js/JavaScript API
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 14
Description
Thanks for this tool. It would be impossible to develop Azure Functions locally without it.
I couldn't find an issue template, so I hope this is OK.
It would be very nice if there was a JavaScript API for running this tool. Currently I'm doing something like this to run `func` together with Azurite, Browsersync, and Webpack:
```js
const { spawn } = require('child_process');
const path = require('path');
spawn(
'func',
['start', '--script-root', 'dist'],
{
cwd: path.resolve(__dirname, '..'),
shell: true,
stdio: 'inherit',
}
);
```
This doesn't feel very nice, and I still haven't found a good way of ending the process (the return value of `spawn`'s `.kill()` kind of works, but always ends with the message `Host did not shutdown within its allotted time.`).
What I really want would be able to require this module and use its JavaScript API for whatever a project needs. Something like:
```js
const func = require('azure-functions-core-tools');
func.start({
scriptRoot: './dist'
});
```
This would be a much more ergonomic solution to running this tool together with others as a part of a more complete development environment.
Contributor guide
Research direction
No repository file or test is named. Start by locating the `func start` entry point and the existing Node.js package boundary, then determine how a JavaScript API could expose startup options and reliable shutdown. Done would require an agreed API shape, lifecycle behavior, and coverage for the example use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100