Reusable CJS code


Keywords
javscript, commonjs, hacktoberfest
License
MIT
Install
npm install @es-labs/node@0.0.39

Documentation

Description

This project contains reusable and shared JS code for use in JS projects.

The following libraries are:

  • node - Common JS reusables
  • esm - ES Modules reusables

The common tools are:

  • tools/dbdeploy/README.md - deploying a database using the following suppored clients
    • Knex (sqlite, mysql, postgres, mssql, snowflake, ...)

Workspace

  1. listing workspaces npm ls -ws

  2. Updating major version by workspace npm i @node-saml/node-saml@latest --workspace=libs/node

Updating

npm outdated
# may need to edit the package.json file if library is in yellow
npm update --save

Publishing packages to npm

Update Version

IMPORTANT before publish, bump version in each project using npm version command (see npm version --help for explanation)

# see package.json on more info
npm run patch:node # for libs/node
npm run patch:esm # for libs/esm

Publish Package

# npm publish --access public --workspace=<workspace>
# need to use --access public as it is scoped package on free plan
npm run pub:node # for libs/node
npm run pub:esm # for libs/esm

# OR Publish using Github Actions .github/workflows/npm-publish.yml (add AUTH TOKEN from npm to Github Secrets)

References