-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: JSON.stringify values with
typeof 'object'
- `examples/echo` and `examples/echo-async` no longer need to do it - Updated documentation in examples, tests and README
- Loading branch information
Showing
5 changed files
with
19 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
module.exports = { | ||
/** | ||
* The "Hello, world" of a `run` method, it uses `JSON.stringify` | ||
* on all passed arguments, so it is more easy to see how many arguments have been passed. | ||
* (This way it is more easy to parse the output with other shell tools like `jq`.) | ||
* The "Hello, world" of a `run` method, | ||
* it returns all passed arguments as an Array. | ||
* (Runex prints the JSON to stdout by default.) | ||
* | ||
* This way tests can check how many arguments have been passed. | ||
* | ||
* Usage: | ||
* `npx runex examples/echo` // [] | ||
* `npx runex examples/echo Hello world` // ["Hello", "world"] | ||
* `npx runex examples/echo 'Hello, world'` // ["Hello, world"] | ||
*/ | ||
run: (...args) => { | ||
console.log(JSON.stringify(args)); | ||
} | ||
run: (...args) => args | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters