From 2b1855d0c126613ca1f62ff119e15046bfd1514b Mon Sep 17 00:00:00 2001 From: JAPER Date: Wed, 23 Jul 2025 12:01:11 +1000 Subject: [PATCH] feat: expose invoke CLI --- README.md | 8 ++++++-- package.json | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 006e0c9..fb7555b 100644 --- a/README.md +++ b/README.md @@ -168,10 +168,14 @@ npm test ## CLI Usage -Invoke the handler locally with a JSON event file: +Invoke the handler locally with a JSON event file. You can run it directly +with `npx` or after installing the package globally: ```bash -npm run invoke -- examples/http-v1.json +npx aws-lambda-nodejs-handler invoke examples/http-v1.json +# or +npm install -g aws-lambda-nodejs-handler +invoke examples/http-v1.json ``` Sample payloads for all supported sources live under the `examples/` directory. diff --git a/package.json b/package.json index 29e6cc3..adb9d84 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "1.0.0", "description": "This is a handler for all AWS Lambda invocations.", "main": "index.mjs", + "bin": { + "invoke": "bin/invoke.js" + }, "scripts": { "lint": "eslint .", "test": "NODE_OPTIONS=--experimental-vm-modules jest",