{"id":15193855,"url":"https://github.com/azure/azure-functions-pack","last_synced_at":"2025-10-02T08:31:15.176Z","repository":{"id":66003596,"uuid":"81718180","full_name":"Azure/azure-functions-pack","owner":"Azure","description":"Easily package your Node.js Functions for Azure Functions","archived":true,"fork":false,"pushed_at":"2022-11-28T19:35:51.000Z","size":145,"stargazers_count":153,"open_issues_count":48,"forks_count":31,"subscribers_count":43,"default_branch":"dev","last_synced_at":"2025-01-12T06:09:10.261Z","etag":null,"topics":["azure-functions","javascript","nodejs","webpack","webpack2"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-12T10:25:26.000Z","updated_at":"2024-10-11T20:17:28.000Z","dependencies_parsed_at":"2023-02-28T03:01:12.630Z","dependency_job_id":null,"html_url":"https://github.com/Azure/azure-functions-pack","commit_stats":{"total_commits":32,"total_committers":12,"mean_commits":"2.6666666666666665","dds":0.5,"last_synced_commit":"51d0b6384303022800af2af9b1e0ed096693fb38"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-functions-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-functions-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-functions-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-functions-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/azure-functions-pack/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234957823,"owners_count":18913355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-functions","javascript","nodejs","webpack","webpack2"],"created_at":"2024-09-27T22:05:42.103Z","updated_at":"2025-10-02T08:31:14.766Z","avatar_url":"https://github.com/Azure.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NOTE: This repository is no longer actively maintained\nThis tool has been replaced with [Run From Package](https://docs.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package).\n\nAzure Functions Pack was created to address significant cold start delays incurred by slow file read operations (read \"The problem addressed\" below). Azure Functions Pack reduces file read operation delays by condensing everything into one file. Run From Package addresses this same problem by keeping files as one payload and using a virtual file system that is much faster than the slower file system used by default. Run From Package works with function apps written in all languages and includes other benefits (such as atomicity, predictability, and faster deployment). You can read more about the benefits of Run From Package [here](https://github.com/Azure/app-service-announcements/issues/84), and you can read more about deploying with Run From Package [here](https://docs.microsoft.com/azure/azure-functions/run-functions-from-deployment-package). If you are already using [Zip deployment for Azure Functions](https://docs.microsoft.com/azure/azure-functions/deployment-zip-push), it's only a matter of adding `WEBSITE_RUN_FROM_PACKAGE = 1` to your App Settings.\n\n# Azure Functions Pack\n\nThis is a tool to make it easy to package your Azure Functions Node.js Functions for optimal performance on Azure Functions.\n\n## The problem addressed\n\nWhenever 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.\n\n## The solution\n\nA 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!\n\n## How to run\n\nIn the Function App directory:\n\n```\nnpm install -g azure-functions-pack\nfuncpack pack ./\n```\n\nYou can then test locally using the CLI tool: `func run \u003cmyfunc\u003e`\n\nWhen 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.\n\n## Alternative when git deploying to Azure Functions\n\nYou can set the `SCM_USE_FUNCPACK` app setting to 1, and we'll install your packages and pack them whenever you git deploy. We recommend git deploying into a deployment slot and then swapping to prod to avoid downtime and resource contention. You can learn more about how to customize deployments on the [kudu wiki](https://github.com/projectkudu/kudu/wiki/Configurable-settings#automatically-run-funcpack-on-function-app-git-deployments).\n\n## API\n\n```\nUsage: funcpack [options] [command]\n\n\n  Commands:\n\n    unpack [options] \u003cpath\u003e  Will remove all traces of packing tool at the specified path or the current directory if none is specified\n    pack [options] \u003cpath\u003e    Will pack the specified path or the current directory if none is specified\n\n  Options:\n\n    -h, --help           output usage information\n    -u, --uglify         Uglify the project when webpacking\n    -o, --output \u003cpath\u003e  Path for output directory\n    -c, --copyToOutput   Copy files to output directory\n```\n\nThe `copyToOutput` option will copy all the important files for you to the `output` directory (aka `.funcpack`) and modify them there. This will let you publish from the `output` directory without having to touch your source code or remove your `node_modules` to save space. You can simply:\n\n```\nfuncpack pack -c .\ncd .funcpack\nfunc azure functionapp publish \u003cmyapp\u003e\n``` \n\n### unpack\n\n```\nUsage: unpack [options] \u003cpath\u003e\n\n  Will remove all traces of packing tool at the specified path or the current directory if none is specified\n\n  Options:\n\n    -h, --help           output usage information\n    -o, --output \u003cpath\u003e  Path for output directory\n```\n\nNote: the uglify feature only supports some small amount of es6, so I recommend that if you get errors either don't uglify or drop your code down to es5. \n\nUglify will minimize the sample project that's included from 27 MB to 9 MB.\n\n### pack\n\n```\nUsage: pack [options] \u003cpath\u003e\n\n  Will pack the specified path or the current directory if none is specified\n\n  Options:\n\n    -h, --help               output usage information\n    -u, --uglify             Uglify the project when webpacking\n    -o, --output \u003cpath\u003e      Path for output directory\n    -c, --copyToOutput       Copy files to output directory\n    -e, --editConfig \u003cpath\u003e  Customize webpack config by applying function in this file\n```\n\nThe `editConfig` option will let you specify a js file containing a function to alter the webpack configuration.\n\n```\n// $root/webpack.config.js\n\nmodule.exports = function(config, webpack) {\n    config.plugins.push(new webpack.DefinePlugin({ \"global.GENTLY\": false }));\n    return config;\n}\n```\n\n### funcpack.config.json\n\nPack will optionally take in a config file that will let you further customize the behavior. The config file must be in the directory you run the command from and named `funcpack.config.json`.\n\nHere are all the supported options:\n\n```\n{\n  \"ignoredModules\":[\"chai\"]\n}\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fazure-functions-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fazure-functions-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fazure-functions-pack/lists"}