{"name":"@vercel/ncc","version":"0.38.4","license":"MIT","_id":"@vercel/ncc@0.38.4","maintainers":[{"name":"nick.tracey","email":"nick.tracey@vercel.com"},{"name":"matt.straka","email":"matt.j.straka@gmail.com"},{"name":"vercel-release-bot","email":"infra+release@vercel.com"},{"name":"zeit-bot","email":"team@zeit.co"}],"homepage":"https://github.com/vercel/ncc#readme","bugs":{"url":"https://github.com/vercel/ncc/issues"},"bin":{"ncc":"dist/ncc/cli.js"},"dist":{"shasum":"e1fb8be9e7ed33bf44c121131d4c6e95f784afac","tarball":"http://registry-npm.ywwl.com/@vercel/ncc/download/@vercel/ncc-0.38.4.tgz","fileCount":127,"integrity":"sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==","signatures":[{"sig":"MEQCIBekJjuf4G0gbZSFQCypT3sv/2NrmokwYWUj3nwPELi7AiA1BkwJa8y+BUfxgVwjpkgQBSAE7kp+AEHKvvnfMx5TZg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16556248,"size":3663474,"noattachment":false,"key":"/@vercel/ncc/-/@vercel/ncc-0.38.4.tgz"},"main":"./dist/ncc/index.js","gitHead":"e72d34d97e7cb2348af19993b6cdb6fec5374ac9","scripts":{"test":"node --expose-gc --max_old_space_size=4096 node_modules/jest/bin/jest.js","build":"node scripts/build.js","test-coverage":"node --expose-gc --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --coverage --globals \"{\\\"coverage\\\":true}\"","prepublishOnly":"node scripts/build.js --no-cache","build-test-binary":"cd test/binary && node-gyp rebuild && cp build/Release/hello.node ../integration/hello.node"},"_npmUser":{"name":"vercel-release-bot","email":"infra+release@vercel.com"},"repository":{"url":"git+https://github.com/vercel/ncc.git","type":"git"},"_npmVersion":"6.14.18","description":"Simple CLI for compiling a Node.js module into a single file, together with all its dependencies, gcc-style.","directories":{},"_nodeVersion":"20.19.5","_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","devDependencies":{"pg":"^8.11.3","arg":"^5.0.2","esm":"^3.2.22","got":"^12.5.2","koa":"^3.0.1","npm":"^6.13.4","pug":"^3.0.1","vm2":"^3.9.19","vue":"^2.5.17","copy":"^0.3.2","glob":"^8.0.3","jest":"^27.5.1","jimp":"^0.16.1","rxjs":"^7.8.1","swig":"^1.4.2","when":"^3.7.8","auth0":"^2.14.0","axios":"^1.7.7","bytes":"^3.1.2","mysql":"^2.16.0","react":"^17.0.2","redis":"^3.1.1","sharp":"^0.32.5","canvas":"3.0.0-rc2","cowsay":"^1.3.1","mkdirp":"^1.0.4","pdfkit":"^0.13.0","stripe":"^8.167.0","terser":"^5.33.0","twilio":"^3.23.2","core-js":"^2.5.7","express":"^4.18.2","fontkit":"^1.7.7","graphql":"^15.5.1","ioredis":"^5.3.2","mailgun":"^0.5.0","mariadb":"^2.0.1-beta","request":"^2.88.0","webpack":"5.94.0","fetch-h2":"^3.0.2","firebase":"^7.24.0","loopback":"^3.24.0","mongoose":"^8.8.3","node-gyp":"^9.4.0","oracledb":"^6.1.0","passport":"^0.6.0","saslprep":"^1.0.2","hot-shots":"^8.5.0","leveldown":"^6.0.0","memcached":"^2.2.2","memory-fs":"^0.5.0","react-dom":"^17.0.2","sequelize":"^6.32.1","socket.io":"^4.7.2","ts-loader":"^9.4.4","chromeless":"^1.5.2","jugglingdb":"2.0.1","lighthouse":"^8.1.0","the-answer":"^1.0.0","typescript":"^5.2.2","web-vitals":"^0.2.4","@bugsnag/js":"^7.21.0","consolidate":"^0.16.0","graceful-fs":"^4.2.11","@sentry/node":"^7.66.0","@azure/cosmos":"^3.17.3","azure-storage":"^2.10.2","fluent-ffmpeg":"^2.1.2","path-platform":"^0.11.15","@slack/web-api":"^6.9.0","analytics-node":"^6.2.0","firebase-admin":"^11.10.1","shebang-loader":"^0.0.1","tiny-json-http":"^7.5.1","tsconfig-paths":"^4.2.0","get-folder-size":"^2.0.0","@aws-sdk/client-s3":"^3.787.0","isomorphic-unfetch":"^4.0.2","source-map-support":"^0.5.9","vue-server-renderer":"^2.5.17","apollo-server-express":"^2.2.2","browserify-middleware":"^8.1.1","passport-google-oauth":"^2.0.0","@google-cloud/bigquery":"^5.7.0","license-webpack-plugin":"^4.0.2","@google-cloud/firestore":"^6.7.0","@ffmpeg-installer/ffmpeg":"^1.0.17","tsconfig-paths-webpack-plugin":"^4.1.0","@vercel/webpack-asset-relocator-loader":"1.7.3"},"_npmOperationalInternal":{"tmp":"tmp/ncc_0.38.4_1758204913230_0.9658699132015034","host":"s3://npm-registry-packages-npm-production"},"readme":"# ncc\n\n[![CI Status](https://github.com/vercel/ncc/actions/workflows/ci.yml/badge.svg)](https://github.com/vercel/ncc/actions/workflows/ci.yml)\n\nSimple CLI for compiling a Node.js module into a single file,\ntogether with all its dependencies, gcc-style.\n\n## Motivation\n\n- Publish minimal packages to npm\n- Only ship relevant app code to serverless environments\n- Don't waste time configuring bundlers\n- Generally faster bootup time and less I/O overhead\n- Compiled language-like experience (e.g.: `go`)\n\n## Design goals\n\n- Zero configuration\n- TypeScript built-in\n- Only supports Node.js programs as input / output\n- Support all Node.js patterns and npm modules\n\n## Usage\n\n### Installation\n```bash\nnpm i -g @vercel/ncc\n```\n\n### Usage\n\n```bash\n$ ncc <cmd> <opts>\n```\nEg:\n```bash\n$ ncc build input.js -o dist\n```\n\nIf building an `.mjs` or `.js` module inside a `\"type\": \"module\"` [package boundary](https://nodejs.org/dist/latest-v16.x/docs/api/packages.html#packages_package_json_and_file_extensions), an ES module output will be created automatically.\n\nOutputs the Node.js compact build of `input.js` into `dist/index.js`.\n\n> Note: If the input file is using a `.cjs` extension, then so will the corresponding output file.\n> This is useful for packages that want to use `.js` files as modules in native Node.js using\n> a `\"type\": \"module\"` in the package.json file.\n\n#### Commands:\n```\n  build <input-file> [opts]\n  run <input-file> [opts]\n  cache clean|dir|size\n  help\n  version\n```\n\n#### Options:\n```\n  -o, --out [dir]          Output directory for build (defaults to dist)\n  -m, --minify             Minify output\n  -C, --no-cache           Skip build cache population\n  -s, --source-map         Generate source map\n  -a, --asset-builds       Build nested JS assets recursively, useful for\n                           when code is loaded as an asset eg for workers.\n  --no-source-map-register Skip source-map-register source map support\n  -e, --external [mod]     Skip bundling 'mod'. Can be used many times\n  -q, --quiet              Disable build summaries / non-error outputs\n  -w, --watch              Start a watched build\n  -t, --transpile-only     Use transpileOnly option with the ts-loader\n  --v8-cache               Emit a build using the v8 compile cache\n  --license [file]         Adds a file containing licensing information to the output\n  --stats-out [file]       Emit webpack stats as json to the specified output file\n  --target [es]            ECMAScript target to use for output (default: es2015)\n                           Learn more: https://webpack.js.org/configuration/target\n  -d, --debug              Show debug logs\n```\n\n### Execution Testing\n\nFor testing and debugging, a file can be built into a temporary directory and executed with full source maps support with the command:\n\n```bash\n$ ncc run input.js\n```\n\n### With TypeScript\n\nThe only requirement is to point `ncc` to `.ts` or `.tsx` files. A `tsconfig.json`\nfile is necessary. Most likely you want to indicate `es2015` support:\n\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"es2015\",\n    \"moduleResolution\": \"node\"\n  }\n}\n```\n\nIf typescript is found in `devDependencies`, that version will be used.\n\n### Package Support\n\nSome packages may need some extra options for ncc support in order to better work with the static analysis.\n\nSee [package-support.md](package-support.md) for some common packages and their usage with ncc.\n\n### Programmatically From Node.js\n\n```js\nrequire('@vercel/ncc')('/path/to/input', {\n  // provide a custom cache path or disable caching\n  cache: \"./custom/cache/path\" | false,\n  // externals to leave as requires of the build\n  externals: [\"externalpackage\"],\n  // directory outside of which never to emit assets\n  filterAssetBase: process.cwd(), // default\n  minify: false, // default\n  sourceMap: false, // default\n  assetBuilds: false, // default\n  sourceMapBasePrefix: '../', // default treats sources as output-relative\n  // when outputting a sourcemap, automatically include\n  // source-map-support in the output file (increases output by 32kB).\n  sourceMapRegister: true, // default\n  watch: false, // default\n  license: '', // default does not generate a license file\n  target: 'es2015', // default\n  v8cache: false, // default\n  quiet: false, // default\n  debugLog: false // default\n}).then(({ code, map, assets }) => {\n  console.log(code);\n  // Assets is an object of asset file names to { source, permissions, symlinks }\n  // expected relative to the output code (if any)\n})\n```\n\nWhen `watch: true` is set, the build object is not a promise, but has the following signature:\n\n```js\n{\n  // handler re-run on each build completion\n  // watch errors are reported on \"err\"\n  handler (({ err, code, map, assets }) => { ... })\n  // handler re-run on each rebuild start\n  rebuild (() => {})\n  // close the watcher\n  void close ();\n}\n```\n\n## Caveats\n\n- Files / assets are relocated based on a [static evaluator](https://github.com/vercel/webpack-asset-relocator-loader#how-it-works). Dynamic non-statically analyzable asset loads may not work out correctly\n","publish_time":1758204913483,"_cnpm_publish_time":1758204913483,"dist-tags":{"latest":"0.45.0"}}