Start a HTTP server which runs commands when pinged.
Start a server to run commands when touched.
It was designed to allow for execution of semi-frequent commands but not on every save.
This is accomplished by being a generic HTTP server with the ability to write text editor specific plugins to ping the server.
Sublime Text 2 terminal
Install the module globally with:
npm install -g listen-spawn
# Navigate to your working directorycd my_project# Set up listen-spawn to run `npm test`listen-spawn -- npm test # Listening at [...]# In a separate process, curl the server to run `npm test` againcurl http://localhost:3000/ # > email@example.com test [...]
I am still looking for a silent yet plugin-free solution. If really want a one-off plugin, please open a GitHub issue.
For the time being, the following shortcut invokes a
curl request to
alt+x is pressed.
// Add the following to your "Key Bindings - User" inside the "keys": "alt+x" "command": "exec" "args": "cmd": "curl" ""
listen-spawn installs a CLI endpoint via
npm. It is good practice to always use
-- to separate
command as this can lead to unintended parsing.
$ listen-spawnUsage: listen-spawn [options] -- command [args...]Starts server and invokes command with arguments whenever touched.Options:--port Port to start server on [default: 3000]
$ listen-spawn -- mocha test/assert.js20 Jun 04:17:58 - [listen-spawn] Listening at http://localhost:3000/20 Jun 04:17:58 - [listen-spawn] Starting new process -- mocha test/assert.js․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․42 tests complete20 Jun 04:17:58 - [listen-spawn] App exited cleanly
$ listen-spawn -- node example/launch.js20 Jun 04:20:25 - [listen-spawn] Listening at http://localhost:3000/20 Jun 04:20:25 - [listen-spawn] Starting new process -- node example/launch.jsStarting browser[...]
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via grunt and test via
Copyright (c) 2013 Todd Wolfson
Licensed under the MIT license.