An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format (CJS). It can be used in Node.js and browser applications.
Read the blog post for more information.
- Run
npm install
in your terminal - Then run
npm run build
- Update the
package.json
file "name" field with your own package name. Example@username/package-name
- Create an account with npm if you don't have one already. Also be sure to enable two-factor authentication
- Sign in to your npm account in your terminal with
npm login
- Run
npm publish --access=public
to publish your package