js-insert

1.1.2 • Public • Published

js-insert Build Status

Insert javascript into javascript

Install

Install the module with: npm install js-insert

var insert = require('js-insert');

API

insert.into(<filename>, <matcher>, <insert>);

matcher options:

Defines the structure of where to insert code into

{
  obj: '',
  func: '',
  nested: {
    obj: '',
    nested: {
      key: ''
    }
  }
}

value options:

{
  code: {
    code: '',
    before: {
      obj: '',
      func: '',
      ret: true
    },
    after: {
    }
  },
  param: {
    param: '',
    type: 'literal|variable', //variable is default
    obj: {
      key: '',
      value: ''
      type: 'literal|variable' //variable is default
    },
    func: {
      param: '',
      type: 'literal|variable' //variable is default
    },
    arr: {
      param: '',
      type: 'literal|variable' //variable is default
    }
  }
}

Release History

  • v0.0.1, TBD

License

Copyright (c) 2014 Jeffrey Kwan. Licensed under the MIT license.

Dependencies (3)

Dev Dependencies (8)

Package Sidebar

Install

npm i js-insert

Weekly Downloads

1

Version

1.1.2

License

MIT

Last publish

Collaborators

  • jeffreykwan