Azure / Azure/azure-functions-nodejs-worker
Publish types package for core api
- Dominant language
- TypeScript
- Stars
- 110
- Forks
- 51
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 2
Description
This work is partially done already, but we are open to changes so I want an issue for potential feedback and to track any remaining work.
The main idea is that we want users to provide information (i.e. hooks and functions) programmatically, meaning we need to define an API in which they can do that. As a part of the hooks feature, we settled on a "built-in" module named `@azure/functions-core`. See [here](https://github.com/ejizba/func-nodejs-prototype#split-up-the-worker) for some more background. Here is example usage as described in https://github.com/Azure/azure-functions-nodejs-worker/pull/548:
```typescript
import { registerHook } from '@azure/functions-core';
registerHook('preInvocation', (context: PreInvocationContext) => {
});
```
The main alternative we have considered is for the user to return hooks/functions in a [startup file](https://github.com/Azure/azure-functions-nodejs-worker/issues/537) as a module export. Example usage described [here](https://github.com/Azure/azure-functions-nodejs-worker/issues/522#issuecomment-1034609167).
## Remaining work
- Create and publish a `@types/azure_functions-core` package
- Improve es modules support. Currently users have to use `require` instead of `import` (workaround [here](https://github.com/Azure/azure-functions-nodejs-worker/pull/548#discussion_r833652131))
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.