A public organization scoped package hosted on the npm registry.
- Set as a git repository and add a git remote
- Create an npm package scoped to the organization
npm init --scope=@my-org
- Create a
README.md
for package -
"type": "modules"
should be set inpackage.json
if using ES6 modules - set the main entry point for package
- Compile typescript code if needed. Packages are generally accessed through compiled javascript code.
- Create a
.npmignore
file to exclude src, node_modules, git, ts, etc. from the npm package when it is published. npm install
-
npm run build
to compile if needed
- Test your package by installing it into another project with the full path to your package
npm install <path/to/package>
Push code to source control first.
By default npm packages are published with private access
publish with public access
npm publish --access public