Gathering detailed insights and metrics for @crabas0npm/aspernatur-facilis-cupiditate
Gathering detailed insights and metrics for @crabas0npm/aspernatur-facilis-cupiditate
npm install @crabas0npm/aspernatur-facilis-cupiditate
Typescript
Module System
Node Version
NPM Version
48.1
Supply Chain
48.1
Quality
75.5
Maintenance
100
Vulnerability
99.6
License
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
2
Compared to previous week
Last month
-44.4%
5
Compared to previous month
Last year
0%
134
Compared to previous year
34
@crabas0npm/aspernatur-facilis-cupiditate
is a lighter-weight, more narrowly focused package that aims to accomplish some of the goals of regenerator, while remaining small enough that it won’t (completely) break a website’s performance budget if run in the browser. It may not be able to boast as impressive size reductions as preact has compared to react, but it is a quarter of the size of regenerator (minified and gzipped), while supporting most of the same features.
This library does not aim to support the full set of ES6 to ES5 transforms. Specifically, it supports:
let
and const
) to var
It intentionally does not (and will not) support transforms for:
This function accepts a javascript string and returns ES5-compatible
javascript. If generators are involved, it assumes regeneratorRuntime
is available in the global scope.
1// input 2import { compile } from '@crabas0npm/aspernatur-facilis-cupiditate'; 3 4console.log(compile('function *gen() { yield 1; }')); 5 6// output 7var _marked = /* #__PURE__ */ regeneratorRuntime.mark(gen); 8function gen() { 9 return regeneratorRuntime.wrap(function gen$(_context) { 10 while (1) switch (_context.prev = _context.next) { 11 case 0: 12 _context.next = 2; 13 return 1; 14 case 2: 15 case "end": 16 return _context.stop(); 17 } 18 }, _marked); 19}
Also importable from @@crabas0npm/aspernatur-facilis-cupiditate/transform
; performs an AST transform
(conforming to the ESTree Spec) to
ES5-compatible AST.
1import transform from '@@crabas0npm/aspernatur-facilis-cupiditate/transform'; 2 3// input: AST for `let {x} = y` 4var ast = transform({ 5 type: 'File', 6 program: { 7 type: 'Program', 8 body: [{ 9 type: 'VariableDeclaration', 10 kind: 'let', 11 declarations: [{ 12 type: 'VariableDeclarator', 13 id: { 14 type: 'ObjectPattern', 15 properties: [ 16 { 17 type: 'ObjectProperty', 18 key: {type: 'Identifier', name: 'x'}, 19 value: {type: 'Identifier', name: 'x'}, 20 shorthand: true 21 } 22 ] 23 }, 24 init: {type: 'Identifier', name: 'y'} 25 }] 26 }] 27 } 28}); 29console.log(ast); 30 31// result: AST for `var _y = y; var x = _y.x` 32{ 33 type: 'File', 34 program: { 35 type: 'Program', 36 body: [{ 37 type: 'VariableDeclaration', 38 kind: 'var', 39 declarations: [{ 40 type: 'VariableDeclarator', 41 id: {type: 'Identifier', name: '_y'}, 42 init: {type: 'Identifier', name: 'y'} 43 }] 44 }, { 45 type: 'VariableDeclaration', 46 kind: 'var', 47 declarations: [{ 48 type: 'VariableDeclarator', 49 id: {type: 'Identifier', name: 'x'}, 50 init: { 51 type: 'MemberExpression', 52 object: {type: 'Identifier', name: '_y'}, 53 property: {type: 'Identifier', name: 'x'}, 54 computed: false 55 } 56 }] 57 }] 58 } 59}
Stringifies AST (using astring), papering over some of the differences between the ESTree implementation of babylon, acorn, and astring.
@@crabas0npm/aspernatur-facilis-cupiditate/ast-types
TK
No vulnerabilities found.
No security vulnerabilities found.