A bare-bones example repository demonstrating how to create a JavaScript library using Rollup, including importing a CommonJS module from node_modules. The library 'how-long-till-lunch' uses the 'ms' package to calculate time until lunch. This is a starter template, not a standalone library; version 1.0.16 is active but has no maintainer activity. Key differentiators: it provides CommonJS, ES module, and UMD builds via Rollup, with variations for Babel or Bublé transpilation. Not intended for production use as a dependency.
npm install ycp-rollup-starter-libVerified import paths — ran on the pinned version, not inferred.
Shows how to clone, build, and use the example library with ES module import syntax, demonstrating the standard workflow for this starter.
Clone the GitHub repo instead: git clone https://github.com/rollup/rollup-starter-lib.git
Consider using Dependabot or Renovate for dependency updates.
If you use the starter as a base for your own library, move 'ms' to dependencies if your library uses it at runtime.
Run npm install --save ms to add it as a runtime dependency, or ensure you run your application from within the project directory.
Run npm install before npm run build.
Use Node.js version 13 or later with --experimental-modules flag, or use the CommonJS bundle instead.