Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roggervalf/create-node-library
CLI for easily bootstrapping modern node packages
https://github.com/roggervalf/create-node-library
Last synced: 29 days ago
JSON representation
CLI for easily bootstrapping modern node packages
- Host: GitHub
- URL: https://github.com/roggervalf/create-node-library
- Owner: roggervalf
- Created: 2020-03-22T18:29:53.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:48:10.000Z (almost 2 years ago)
- Last Synced: 2024-11-16T00:14:00.392Z (about 1 month ago)
- Language: JavaScript
- Size: 3.42 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @node/create-library
> CLI for creating reusable, modern Node libraries using Rollup.
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
## Features
- Easy-to-use CLI
- Handles all modern JS features
- Bundles `cjs` and `es` module formats
- [Rollup](https://rollupjs.org/) for bundling
- [Babel](https://babeljs.io/) for transpiling
- [Jest](https://facebook.github.io/jest/) for testing
- Supports complicated peer-dependencies
- Optional support for TypeScript
- Sourcemap creation
- Thorough documentation :heart_eyes:## Install globally
This package requires `node >= 5`, but we recommend `node >= 8`.
```bash
npm install -g @node/create-library
```## Usage with npx
```bash
npx @node/create-library
```_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_
## Creating a New Module
```bash
@node/create-library
```Answer some basic prompts about your module, and then the CLI will perform the following steps:
- copy over the template
- install dependencies via yarn or npm
- link packages together for local development
- initialize local git repoAt this point, your new module should resemble this screenshot and is all setup for local development.
## Development
Local development is broken into two parts (ideally using two tabs).
First, run rollup to watch your `src/` module and automatically recompile it into `dist/` whenever you make changes.
```bash
npm start # runs rollup with watch flag
```The second part will be running the `example/` that's linked to the local version of your module.
```bash
# (in another tab)
cd example
npm start # runs node index.js
```![](https://media.giphy.com/media/12NUbkX6p4xOO4/giphy.gif)
#### Publishing to npm
```bash
npm publish
```This builds `cjs` and `es` versions of your module to `dist/` and then publishes your module to `npm`.
Make sure that any npm modules you want as peer dependencies are properly marked as `peerDependencies` in `package.json`. The rollup config will automatically recognize them as peers and not try to bundle them in your module.
## License
MIT © [Rogger794](https://github.com/Rogger794)