Skip to content

stefanpenner/petal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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('[email protected]');

newM.ast // => ast remapped regarldess of module format.

newM.exports === {
  '[email protected]': [
    'domHelpers',
    'Morph'
  ],
  '[email protected]/dom_helpers': [
    'domHelpers'
  ],
  '[email protected]/hooks': [
    'content',
    'webComponent',
    'webComponentFallback',
    'element',
    'attribute',
    'concat',
    'subexpr',
    'lookupHelper',
    'simple',
    'hydrationHooks'
  ],
  '[email protected]/utils': [
    'merge'
  ]
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published