0.1.4 • Published 11 years ago

petal v0.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
11 years ago

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'
  ]
});
0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago