Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcollina/bcksrv
Serve your commands like a pro
https://github.com/mcollina/bcksrv
Last synced: 2 months ago
JSON representation
Serve your commands like a pro
- Host: GitHub
- URL: https://github.com/mcollina/bcksrv
- Owner: mcollina
- License: mit
- Created: 2014-08-20T13:07:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-17T16:27:16.000Z (over 10 years ago)
- Last Synced: 2024-10-06T01:48:04.071Z (3 months ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bcksrv
======__bcksrv__ is a tiny module to build command servers easily,
securely and error-safe.This module support the same escaping and quoting of shell commands.
It is implemented through the [shell-quote](http://npm.im/shell-quote) module.Example
-------```js
var server = require('net').createServer()
, srv = require('./')()srv.register('echo', function(rest, stream, cb) {
stream.write(rest.join(' '))
stream.write('\n')
cb()
})srv.register('err', function(rest, stream, cb) {
cb(new Error('muahha'))
})server.on('connection', function(conn) {
conn.pipe(srv.stream()).pipe(conn)
})server.listen(3000)
```Acknowledgements
----------------This project was kindly sponsored by [nearForm](http://nearform.com).
License
-------MIT