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",