@orangewall/api-lambda-utils
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

api-lambda-utils

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.

Get Started

  1. Run npm install in your terminal
  2. Then run npm run build
  3. Update the package.json with the new version that needs to be published
  4. Create an account with npm if you don't have one already. Also be sure to enable two-factor authentication
  5. Sign in to your npm account in your terminal with npm login
  6. Run npm publish --access=public to publish your package

Testing

  1. Install developer dependencies using the following command in your terminal npm i -D mocha @types/mocha chai @types/chai ts-node
  2. Create a new file .mocharc.json in the root directory with the following contents:
    {
      "extension": ["ts"],
      "spec": "./**/*.spec.ts",
      "require": "ts-node/register"
    }
  3. Create a tests folder
  4. Create an index.spec.ts file in the tests folder
  5. Write unit tests in the index.spec.ts file to test the code in index.ts
  6. Add a "test" property in the package.json file and give it a value of "mocha"
  7. Run npm test in your terminal from the root folder of the project

References

https://snyk.io/blog/best-practices-create-modern-npm-package https://github.com/snyk-snippets/modern-npm-package https://github.com/goldbergyoni/javascript-testing-best-practices

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.6
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.6
    6

Package Sidebar

Install

npm i @orangewall/api-lambda-utils

Weekly Downloads

6

Version

1.2.6

License

MIT

Unpacked Size

29.9 kB

Total Files

21

Last publish

Collaborators

  • orangewall