1.0.5 • Published 2 years ago

brightpearl-cache v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

BuildDirect Lambda Typescript Starter

Key NPM commands

  • npm ci -- Install dependencies from package-lock.json for more repeatable builds
  • npm run build -- Build the javascript into the build folder.
  • npm run lint -- Run TSLint.
  • npm run lint:fix -- Run TSLint Fixers
  • npm test -- Run all tests with coverage.
  • npm run test:unit -- Run all unit tests
  • npm run test:integration -- Run all integration tests
  • npm run local -- Run the function locally.

Setup

  • Setup the AWS CLI by running aws configure using security credentials from your AWS IAM console
  • Ensure that [default] is added at the top of your AWS config file ~/.aws/credentials
  • Ensure you are logged into a BuildDirect NPM account to run npm install
  • Edit ./awsEvent.ts and create a type for the SQS Event your lambda function will be processing
  • Add a primary identifier (Order ID, User etc) to the logging tags in ./src/index.ts
  • Consult logging package docs and determine the interval/batchSize to set. Default setup is only send logs in batches once per invocation.
  • Add your function name to ./src/constants.ts and ./buildspec.yml
  • Add your function specific secret keys to setupSecrets() in index.ts

Development Resources