petal

0.1.4 • Public • Published

petal

Build Status

library for inspecting and renaming various js module formats. This is still WIP but in a usable state.

npm install petal --save
var m = new Petal('vendor/htmlbars-runtime.amd.js', sourceOrAst);
m.hasDefine   // => true
m.isAnonymous // => true
 
m.exports === {
  'htmlbars-runtime': [
    'domHelpers',
    'Morph'
  ],
  'htmlbars-runtime/dom_helpers': [
    'domHelpers'
  ],
  'htmlbars-runtime/hooks': [
    'content',
    'webComponent',
    'webComponentFallback',
    'element',
    'attribute',
    'concat',
    'subexpr',
    'lookupHelper',
    'simple',
    'hydrationHooks'
  ],
  'htmlbars-runtime/utils': [
    'merge'
  ]
});
 
// now, lets remap the current module to another name
newM = m.remap('htmlbars-runtime@2.0.0');
 
newM.ast // => ast remapped regarldess of module format.
 
newM.exports === {
  'htmlbars-runtime@2.0.0': [
    'domHelpers',
    'Morph'
  ],
  'htmlbars-runtime@2.0.0/dom_helpers': [
    'domHelpers'
  ],
  'htmlbars-runtime@2.0.0/hooks': [
    'content',
    'webComponent',
    'webComponentFallback',
    'element',
    'attribute',
    'concat',
    'subexpr',
    'lookupHelper',
    'simple',
    'hydrationHooks'
  ],
  'htmlbars-runtime@2.0.0/utils': [
    'merge'
  ]
});

Readme

Keywords

none

Package Sidebar

Install

npm i petal

Weekly Downloads

0

Version

0.1.4

License

ISC

Last publish

Collaborators

  • chadhietala
  • stefanpenner
  • abuiles