uglifyast

Helpers for converting back and forth between UglifyJS 2 ASTs and JavaScript objects.

22 个版本
安装
npm install uglifyast
yarn add uglifyast
pnpm add uglifyast
bun add uglifyast
README

node-uglifyast

Convert back and forth between UglifyJS ASTs and JavaScript objects.

Example:

var uglifyAst = require('uglifyast');
console.warn(uglifyAst.objToAst({foo: ['bar', 9, 4], quux: {baz: 4}}));

Produces:

[ 'object',
  [ [ 'foo',
      [ 'array', [ [ 'string', 'bar' ], [ 'num', 9 ], [ 'num', 4 ] ] ] ],
    [ 'quux', [ 'object', [ [ 'baz', [ 'num', 4 ] ] ] ] ] ] ]

And the other way around:

console.warn(uglifyAst.astToObj(['array', [['string', 'abc'], ['num', 1]]]));

Output:

[ 'abc', 1 ]

License

3-clause BSD license -- see the LICENSE file for details.

版本列表
0.3.3 2015-08-21
0.3.2 2014-02-22
0.3.1 2013-05-09
0.3.0 2013-05-09
0.3.0rc5 2013-04-01
0.3.0rc4 2013-03-31
0.3.0rc3 2013-03-30
0.3.0rc2 2013-03-25
0.3.0rc1 2013-03-23
0.2.1 2015-08-21
0.2.0 2013-02-27
0.1.2 2013-02-25
0.1.1 2013-02-25
0.1.0 2013-01-22
0.0.8 2013-02-25
0.0.7 2012-11-27
0.0.6 2012-11-22
0.0.5 2012-11-01
0.0.4 2012-10-20
0.0.3 2012-07-25
0.0.2 2012-07-25
0.0.1 2012-07-24