serverless / serverless/serverless
Allow raw output from `sls invoke` without JSON encoding
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.9k
- Forks
- 5.7k
- Avg merge
- 10h 7m
- Merged PRs (30d)
- 57
Description
Is there an existing issue for this?
- I have searched existing issues, it hasn't been reported yet
Use case description
It would be useful to be able to able to get the raw output from the invoke command, similar to how the --raw switch works for input. The invoke and the invoke local commands stringify the output.
At the moment to generate a CSV file the output must be unstringified:
sls invoke local -f export --data XXX | node -e 'console.log(JSON.parse(fs.readFileSync("/dev/stdin", "utf-8")));' > out.csv
Proposed solution (optional)
Adding a --rawOutput command switch.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/plugins/aws/invoke.js and lib/plugins/aws/invoke-local/index.js, where the issue identifies the output stringification. Trace how the invoke commands parse options and emit output, then add the proposed --rawOutput behavior while preserving the existing default. Done means both commands can emit raw output without JSON encoding when the switch is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100