Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amok

Package Overview
Dependencies
Maintainers
1
Versions
808
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amok

No Reload, Live Editing for JavaScript

  • 0.13.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
915
increased by510%
Maintainers
1
Weekly downloads
 
Created
Source

Amok(1)

tips chat npm

Synopsis

amok [options] <SCRIPT | URL>

Installation

npm install amok -g

Description

Amok standalone command line tool that enables rapid prototyping and development of JavaScript based web applications through the client's remote debugging interface.

Given a script as the entry point, it will start a zero configuration http development server with a default overridable generated index.html. The server may be configured to incrementally watch and compile the scripts through preprocessors, compilers and bundlers. Such as typescript, coffeescript, browserify, webpack and babel.

Alternatively a url may be specified as the entry point, in which case it will connect to the client directly without starting the development server.

If the client option is enabled, the executable of that client is located and opened with the correct settings to allow it to accept remote debugging connections.

Once connected to a client it monitors changes in the file system. Eitting events on the global object in the client environment when such changes occur. When a change to the source of a script currently loaded in the client is detected, it gets re-compiled and refreshed in the client without reloading, restarting, interrupting execution, loosing any state, or executing side effects in the client application. Output from the client's console calls gets mirrored into stdout and stderr.

Options

-h, --help
  output usage information

-V, --version
  output the version number

--host <HOST>
  specify http host

--port <PORT>
  specify http port

--debugger-host <HOST>
  specify debugger host

--debugger-port <PORT>
  specify debugger port

-i, --interactive
  enable interactive mode

--client <PRESET | COMMAND>
  specify the client to spawn

--compiler <PRESET | COMMAND>
  specify the compiler to spawn

-v, --verbose
  enable verbose logging mode

A client must already listening on the same remote debugging port when launching, or specified with the client option.

A compiler may be specified to process script sources served via the http server with the compiler option, Any extra arguments and options following the option parsing terminator --, will be passed as extra options to the compiler. The specified compiler must have its executable available via PATH.

Example

amok --client chrome canvas.js
amok --client chrome http://localhost:9090
amok --client chrome --compiler webpack canvas.js

Client Environment

Events get emitted to aid with domain specific requirements. These events are emitted on the global object, if both window and process are available, events will be emitted on both objects.

process

Event: 'add'
  function (filename) { }

Emitted when a file is added.

Event: 'remove'
  function (filename) { }

Emitted when a file is removed.

Event: 'change'
  function (filename) { }

Emitted when the contents of a file is changed.

Event: 'source'
  function (filename) { }

Emitted when a loaded script gets its source re-compiled.

window

Event: 'add'
  function (event) { }

Dispatched when a file is added, event is a CustomEvent with detail containing the filename relative to the current working directory.

Event: 'remove'
  function (event) { }

Dispatched when a file is removed, event is a CustomEvent with detail containing the filename relative to the current working directory.

Event: 'change'
  function (event) { }

Dispatched when the contents of a file changes, event is a CustomEvent with detail containing the filename relative to the current working directory.

Event: 'source'
  function (event) { }

Dispatched when a loaded script gets its source re-compiled, event is a CustomEvent with detail containing the filename relative to the current working directory.

See Also

amok-examples

Keywords

FAQs

Package last updated on 12 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc