Skip to content
Jeffrey Kwan edited this page Dec 18, 2015 · 10 revisions

Purpose

  • Add parameters to function definitions and calls
  • Add code to the body of a function
  • Add key/value to an object

v2.0 API Design (WIP)

Usage

var insert = require('js-insert');
insert
  .code('code')
  .at('selector')
  .into('filename')

Selectors

Now we have to identify where we want to insert code

.arr(name):

Append something to an array variable referenced by 'name'

.func(name):

Add a parameter to a function call or the body of a function declaration

.obj():

{
   obj: 'object' | 'obj.func', | { key: '' }
   func: ''
}
Clone this wiki locally