https://github.com/nodesource/nsolid-command
A N|Solid Custom Command Helper
https://github.com/nodesource/nsolid-command
Last synced: 8 months ago
JSON representation
A N|Solid Custom Command Helper
- Host: GitHub
- URL: https://github.com/nodesource/nsolid-command
- Owner: nodesource
- License: mit
- Archived: true
- Created: 2018-09-11T17:36:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T19:54:34.000Z (over 7 years ago)
- Last Synced: 2025-04-19T20:34:48.778Z (9 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 7
- Watchers: 21
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# N|Solid Custom Command
Implement a [N|Solid custom command][] for your application. For more information please visit our [N|Solid documentation site][].
## Installation
``` bash
npm install nsolid-command
```
## Usage
_Note: For the following example make sure you run your node process with `--expose-gc`_
``` js
const nsolidCommand = require('nsolid-command')
nsolidCommand('gc', request => {
global.gc()
request.return({
status: 'OK',
type: 'gc'
})
})
// or
nsolidCommand({
name: 'gc',
command: request => {
global.gc()
request.return({
status: 'OK',
type: 'gc'
})
}
})
```
From the N|Solid CLI
``` bash
nsolid-cli custom --id --name gc
```
## Contributing
To submit a bug report, please create an [issue at GitHub][].
If you'd like to contribute code to this project, please read the
[CONTRIBUTING.md][] document.
## Authors and Contributors
Julián Duque
GitHub/julianduque
Twitter/@julian_duque
## License & Copyright
**nsolid-command** is Copyright (c) 2018 NodeSource and licensed under the
MIT license. All rights not explicitly granted in the MIT license are reserved.
See the included [LICENSE.md][] file for more details.
[N|Solid documentation site]: https://docs.nodesource.com
[N|Solid custom command]: https://docs.nodesource.com/docs/custom-commands
[issue at GitHub]: https://github.com/nodesource/nsolid-command/issues
[CONTRIBUTING.md]: CONTRIBUTING.md
[LICENSE.md]: LICENSE.md