Skip to content

jeffreykwan/js-insert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-insert Build Status

Undergoing re-write!!

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.

About

Insert javascript into javascript

Resources

Stars

Watchers

Forks

Packages

No packages published