{"id":13447665,"url":"https://github.com/rollup/rollup-starter-lib","last_synced_at":"2025-05-16T09:03:42.075Z","repository":{"id":40302564,"uuid":"96649306","full_name":"rollup/rollup-starter-lib","owner":"rollup","description":"Bare-bones example of how to create a library using Rollup","archived":false,"fork":false,"pushed_at":"2023-11-17T06:28:02.000Z","size":188,"stargazers_count":980,"open_issues_count":23,"forks_count":231,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T04:02:22.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/rollup.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}},"created_at":"2017-07-08T23:19:55.000Z","updated_at":"2025-04-06T08:53:57.000Z","dependencies_parsed_at":"2024-01-26T21:02:11.677Z","dependency_job_id":"a6525560-f509-446e-97d2-bad9151ed365","html_url":"https://github.com/rollup/rollup-starter-lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-starter-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-starter-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-starter-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-starter-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollup","download_url":"https://codeload.github.com/rollup/rollup-starter-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501554,"owners_count":22081528,"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":[],"created_at":"2024-07-31T05:01:23.845Z","updated_at":"2025-05-16T09:03:42.050Z","avatar_url":"https://github.com/rollup.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Packages","others"],"sub_categories":["Community Packages"],"readme":"# rollup-starter-lib\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/rollup/rollup-starter-lib.svg)](https://greenkeeper.io/)\n\nThis repo contains a bare-bones example of how to create a library using Rollup, including importing a module from `node_modules` and converting it from CommonJS.\n\nWe're creating a library called `how-long-till-lunch`, which usefully tells us how long we have to wait until lunch, using the [ms](https://github.com/zeit/ms) package:\n\n```js\nconsole.log('it will be lunchtime in ' + howLongTillLunch());\n```\n\n## Getting started\n\nClone this repository and install its dependencies:\n\n```bash\ngit clone https://github.com/rollup/rollup-starter-lib\ncd rollup-starter-lib\nnpm install\n```\n\n`npm run build` builds the library to `dist`, generating three files:\n\n* `dist/how-long-till-lunch.cjs.js`\n    A CommonJS bundle, suitable for use in Node.js, that `require`s the external dependency. This corresponds to the `\"main\"` field in package.json\n* `dist/how-long-till-lunch.esm.js`\n    an ES module bundle, suitable for use in other people's libraries and applications, that `import`s the external dependency. This corresponds to the `\"module\"` field in package.json\n* `dist/how-long-till-lunch.umd.js`\n    a UMD build, suitable for use in any environment (including the browser, as a `\u003cscript\u003e` tag), that includes the external dependency. This corresponds to the `\"browser\"` field in package.json\n\n`npm run dev` builds the library, then keeps rebuilding it whenever the source files change using [rollup-watch](https://github.com/rollup/rollup-watch).\n\n`npm test` builds the library, then tests it.\n\n## Variations\n\n* [babel](https://github.com/rollup/rollup-starter-lib/tree/babel) — illustrates writing the source code in ES2015 and transpiling it for older environments with [Babel](https://babeljs.io/)\n* [buble](https://github.com/rollup/rollup-starter-lib/tree/buble) — similar, but using [Bublé](https://buble.surge.sh/) which is a faster alternative with less configuration\n* [TypeScript](https://github.com/rollup/rollup-starter-lib/tree/typescript) — uses [TypeScript](https://www.typescriptlang.org/) for type-safe code and transpiling\n\n\n\n## License\n\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-starter-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollup%2Frollup-starter-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-starter-lib/lists"}