Installations
npm install @crabas0npm/aspernatur-facilis-cupiditate
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
20.12.2
NPM Version
10.5.0
Score
48.1
Supply Chain
48.1
Quality
75.5
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Total Downloads
Cumulative downloads
Total Downloads
134
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
34
@crabas0npm/aspernatur-facilis-cupiditate
@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:
- destructuring assignment
- block scoping (
let
andconst
) tovar
- arrow functions
- async / await
- generators (sync and async)
- for ... of loops
- function parameter destructuring
- function parameter defaults
- rest / spread syntax
- simple template literals
- shorthand object properties
- computed object properties
It intentionally does not (and will not) support transforms for:
- classes
- import / export
- react, jsx, flow, or typescript syntax
- tagged template literals
API
@crabas0npm/aspernatur-facilis-cupiditate.compile
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}
@crabas0npm/aspernatur-facilis-cupiditate.transform
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}
@crabas0npm/aspernatur-facilis-cupiditate.generate
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.