create-esm-package
v0.0.4
Published
Create a new ESM npm package with best practices setup
Readme
create-esm-package
A template for creating npm packages.
Setup
- Update
package.jsonwith your package name, description, and repository details - Run
npm installto install dependencies - Start building your package in
src/
Scripts
npm test- Run tests with Jestnpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run checkformat- Check code formatting
Project Structure
├── src/ # Source code
│ └── index.js # Main module exports
├── tests/ # Jest tests
│ └── index.test.js
├── index.js # Package entry point
└── package.jsonUsage
import { hello } from "my-package";
console.log(hello()); // "Hello, World!"
console.log(hello("Developer")); // "Hello, Developer!"