{"id":16456649,"url":"https://github.com/zeekay/handroll","last_synced_at":"2025-07-01T03:40:42.764Z","repository":{"id":57148265,"uuid":"83634135","full_name":"zeekay/handroll","owner":"zeekay","description":"🍣 Expertly rolled JavaScript. CLI + library for bundling JavaScript with Rollup.js","archived":false,"fork":false,"pushed_at":"2024-12-01T06:11:32.000Z","size":419,"stargazers_count":65,"open_issues_count":1,"forks_count":1,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-06-02T01:18:08.752Z","etag":null,"topics":["build-tool","bundling","cli","esmodules","javascript","rollup"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","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/zeekay.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-02T04:26:07.000Z","updated_at":"2024-12-30T19:32:20.000Z","dependencies_parsed_at":"2025-02-23T07:10:40.884Z","dependency_job_id":"90c762b7-6181-4a66-b909-fbc5723bd524","html_url":"https://github.com/zeekay/handroll","commit_stats":null,"previous_names":[],"tags_count":175,"template":false,"template_full_name":null,"purl":"pkg:github/zeekay/handroll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeekay%2Fhandroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeekay%2Fhandroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeekay%2Fhandroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeekay%2Fhandroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeekay","download_url":"https://codeload.github.com/zeekay/handroll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeekay%2Fhandroll/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978405,"owners_count":23239385,"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":["build-tool","bundling","cli","esmodules","javascript","rollup"],"created_at":"2024-10-11T10:27:07.164Z","updated_at":"2025-07-01T03:40:42.720Z","avatar_url":"https://github.com/zeekay.png","language":"CoffeeScript","readme":"# handroll\n\n[![npm][npm-img]][npm-url]\n[![build][build-img]][build-url]\n[![dependencies][dependencies-img]][dependencies-url]\n[![downloads][downloads-img]][downloads-url]\n[![license][license-img]][license-url]\n[![chat][chat-img]][chat-url]\n\n\u003e Expertly rolled JavaScript\n\nJavaScript API and CLI for for bundling opinionated JavaScript with\n[Rollup](https://github.com/rollup/rollup). Provides a similar interface to\nRollup with many options and plugins automatically configured based on format\nand `package.json`.\n\n## Features\n- Automatic external module detection\n- Automatic node module resolution with improved resolution strategy\n- Automatic transforms based on filetype with built-in support for many\n  languages\n- Automatic destination and format detection based on `package.json`:\n    - `main` generates CommonJS module\n    - `module` generates ES module bundle\n    - `bin` generates executable\n- Higher-level formats\n    - `cli` bundles JS into an executable\n    - `web` bundles JS for the browser\n- Built-in minification support\n- Built-in legacy module support\n- Built-in CommonJS support\n- Built-in statistics and details view\n- Improved error handling and logging\n- Sensible defaults\n\n## Install\n```bash\n$ npm install handroll -g\n```\n\n## CLI\n```bash\nhandroll\n\nUsage:\n  handroll \u003centry\u003e [options]\n\nOptions:\n  --commonjs     Enable CommonJS support\n  --output,   -o Destination to write output\n  --format, -f   Format to output\n  --formats      Comma separated list of formats to output\n  --es           ES module format\n  --cjs          CommonJS module format\n  --cli          Executable format\n  --web          Web format\n  --browser      Bundle for browser\n  --name         Name to use for iife module\n  --sourcemap    Enable source map support\n  --minify       Enable minification\n\n  --version      Print version information\n  --help         Print this usage\n```\n\n## JavaScript API\nHandroll's JavaScript API provides an interface similar to Rollup, with the\n`bundle` step being optional (and only useful if you want to cache the\nintermediate bundle). In most cases you'll want to use `.write` or `.generate`\ndirectly.\n\n\n#### handroll.bundle (options) -\u003e Promise\nCreate a new `Bundle` and cache result of `bundle.rollup`.\n\n#### handroll.write  (options) -\u003e Promise\nCreate new `Bundle` and immediately export in appropriate format(s).\n\n#### bundle.write    (options) -\u003e Promise\nWrite bundle in appropriate format(s).\n\n#### bundle.generate (options) -\u003e Promise\nGenerate output in appropriate format(s).\n\n#### bundle.rollup   (options) -\u003e Promise\nAutomatically infer compilers, plugins, formats and other relevant options and\nRollup bundle.\n\n#### options\nAll Handroll operations can be passed the similiar options.\n\n```javascript\nconst bundle = await handroll.bundle({\n  entry: 'src/index.js',  // Path to entry module, required\n\n  // Use `format` or `formats` to customize export format. Handroll defaults to\n  // ES module format. Multiple formats may be specified using `formats`:\n  //\n  // formats: ['cjs', 'es']\n  format: 'es',\n\n  // Use `output` to specify where a given format should be written. By default\n  // Handroll will infer output based on your package.json:\n  //\n  //   format -\u003e default output\n  //   cjs    -\u003e pkg.main\n  //   es     -\u003e pkg.module\n  //   cli    -\u003e pkg.bin\n  //   web    -\u003e pkg.name + '.js'\n  output: 'dist/lib.js',\n\n  // Use `compilers` to customize plugins used per-filetype.\n  //\n  // compilers: {\n  //   coffee: {\n  //     verison: 1  // use CS 1.x instead of 2.x\n  //   }\n  // }\n  //\n  // Or specify your own:\n  //\n  // compilers: {\n  //   js:   buble()\n  //   less: less()\n  // }\n  compilers: {\n    coffee: coffee(),\n    json:   json(),\n    pug:    pug(),\n    styl:   stylus(),\n  },\n\n  // Use `legacy` to specificy non-module scripts and corresponding exports.\n  // Non-module scripts installed with npm will be automatically resolved.\n  //\n  // legacy: {\n  //   './vendor/some.lib.js': 'someLib',\n  //   prismjs: 'Prism'\n  // }\n  legacy: null,\n\n  // Use `plugins` to override plugins Handroll should use. By default Handroll\n  // will try to automatically infer and configure the plugins you should use.\n  //\n  // plugins: [buble(), commonjs()]\n  plugins: null,\n\n  // Use `external` to configure which dependencies Rollup considers external. By\n  // default Handroll will try to automatically infer external dependencies based\n  // on package.json. Normal dependencies are assumed to be external while\n  // devDependencies are assumed to be fully subsumbed during the build step.\n  // You can use `external: false` or an explicit list to disable this behavior.\n  //\n  // external: Object.keys pkg.dependencies\n  external: true,\n\n  // Use `commonjs` to enable importing and customize CommonJS adaptor behavior.\n  //\n  // commonjs:\n  //   namedExports:\n  //     './module.js': ['foo', 'bar']\n  commonjs: false,\n\n  basedir:    './',   // Customize basedir used for resolution\n  details:    false,  // Print extra details about bundle\n  es3:        false,  // Emit slightly more ES3-compliant output\n  executable: false,  // Include shebang and chmod+x output\n  minify:     false,  // Use uglify to minify bundle\n  quiet:      false,  // Suppress default output\n  sourcemap:  true ,  // Collect and save source maps\n  strip:      false,  // Remove debugging and console log statements\n})\n```\n\n## Examples\n```javascript\nimport handroll from 'handroll'\n\n// Create new bundle\nconst bundle = await handroll.bundle({\n  entry: 'src/index.js'\n})\n\n// Write ES module (for use by bundlers)\nawait bundle.write({\n  format: 'es'\n  // output: pkg.module\n})\n\n// Write CommonJS module (for use by Node.js)\nawait bundle.write({\n  format: 'cjs'\n  // output: pkg.main\n})\n\n// Write ES module and CommonJS module\nawait bundle.write({formats: ['cjs', 'es']})\n\n// If you specify 'main' and 'module' in your package.json, both ES module and\n// CommonJS formatted bundles will be generated\nawait bundle.write()\n\n// Write self-executing bundle for web using browser-friendly modules, ensuring no\n// dependencies are excluded\nawait bundle.write({\n  format: 'web',\n  // external: false,\n  // browser:  true,\n  // output:     pkg.name + '.js',\n})\n\n// Write executable with shebang using new entry module\nawait handroll.write({\n  entry:  'src/cli.js',\n  format: 'cli',\n  // executable: true,\n  // external:   true,\n  // output:     pkg.bin,\n})\n\n// Share options across multiple destinations\nconst bundle = new handroll.Bundle({\n  entry:    'src/index.js',\n  external: false\n})\nawait Promise.all([\n  bundle.write({format: 'es'}),\n  bundle.write({format: 'cjs'}),\n])\n```\n\n### Example `package.json`\n```javascript\n{\n  \"name\":        \"mylib\",\n  \"main\":        \"lib/mylib.js\",  // CommonJS output\n  \"module\":      \"lib/mylib.mjs\", // ES module output\n  \"jsnext:main\": \"lib/mylib.mjs\", // For compatibility with outdated bundlers\n\n  // To ensure your generated files are packaged correctly:\n  \"files\": [\n    \"lib/\",\n    \"src/\"\n  ],\n  \"scripts\": {\n    \"prepublishOnly\": \"handroll src/index.js --formats cjs,es\"\n  }\n}\n```\n\n## License\n[MIT][license-url]\n\n[build-img]:        https://img.shields.io/travis/zeekay/handroll.svg\n[build-url]:        https://travis-ci.org/zeekay/handroll\n[chat-img]:         https://badges.gitter.im/join-chat.svg\n[chat-url]:         https://gitter.im/zeekay/hi\n[coverage-img]:     https://coveralls.io/repos/zeekay/handroll/badge.svg?branch=master\u0026service=github\n[coverage-url]:     https://coveralls.io/github/zeekay/handroll?branch=master\n[dependencies-img]: https://david-dm.org/zeekay/handroll.svg\n[dependencies-url]: https://david-dm.org/zeekay/handroll\n[downloads-img]:    https://img.shields.io/npm/dm/handroll.svg\n[downloads-url]:    http://badge.fury.io/js/handroll\n[license-img]:      https://img.shields.io/npm/l/handroll.svg\n[license-url]:      https://github.com/zeekay/handroll/blob/master/LICENSE\n[npm-img]:          https://img.shields.io/npm/v/handroll.svg\n[npm-url]:          https://www.npmjs.com/package/handroll\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeekay%2Fhandroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeekay%2Fhandroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeekay%2Fhandroll/lists"}