Added an explanation
This commit is contained in:
Родитель
7bfbab2871
Коммит
a1ce082da2
12
README.md
12
README.md
|
@ -2,6 +2,14 @@
|
|||
|
||||
This is a tool to make it easy to package your Azure Functions Node.js Functions for optimal performance on Azure Functions.
|
||||
|
||||
## The problem addressed
|
||||
|
||||
Whenever an Azure Function App is recreated on demand (a so called "cold start") the node'js module cache for each Function will be empty. The current Functions file system is sluggish in dealing with many small file accesses so there is a significant delay as node reads all the module files. Fortunately, node caches the modules in memory so subsequent accesses are fast.
|
||||
|
||||
## The solution
|
||||
|
||||
A javascript module bundler (webpack) is used to place all the modules in a single file. The Function `functions.json` files are then modified so this bundle is used rather than the separate modules files. Magic!
|
||||
|
||||
:construction: This project is experimental; use with caution and be prepared for breaking changes :construction:
|
||||
|
||||
## How to run
|
||||
|
@ -13,7 +21,7 @@ funcpack pack ./
|
|||
|
||||
You can then test locally using the CLI tool: `func run <myfunc>`
|
||||
|
||||
When uploading your files, you need to include your `package.json`, but you don't need your `node_modules` directory.
|
||||
When uploading your files, you need to include the single `.funcpack` directory (in the Functions App root), but you don't need your `node_modules` directory for each Function.
|
||||
|
||||
## API
|
||||
|
||||
|
@ -66,4 +74,4 @@ Usage: pack [options] <path>
|
|||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
[MIT](LICENSE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче