npm.io
1.0.23 • Published 2 years ago

nv-jsparser-helper

Licence
ISC
Version
1.0.23
Deps
1
Size
364 kB
Vulns
0
Weekly
0

nv-jsparser-helper

  • simple wrap of @babel/parser
  • expose more apis for copy/paste AND using in another project

DFLT OPTS

    const defaultOptions = {
      sourceType: "module",
      sourceFilename: undefined,
      startLine: 1,
      allowAwaitOutsideFunction: true,
      allowReturnOutsideFunction: true,
      allowImportExportEverywhere: true,
      allowSuperOutsideMethod: true,
      allowUndeclaredExports: true,
      allowLineBreakAfterAsync:true,   //-
      plugins: [
          'typescript','v8intrinsic','placeholders','decorators-legacy',
          "classProperties",'classPrivateProperties',
          'classPrivateMethods','decimal','partialApplication',
          ['recordAndTuple',{syntaxType:'hash'}],
          'topLevelAwait',
          'awaitInNonAsync', //-
      ],
      strictMode: null,
      ranges: false,
      tokens: true,
      createParenthesizedExpressions: false,
      errorRecovery: false,
      max_size:1000000
    };

   ### placeholders
       ¥ 

   ### allowLineBreakAfterAsync:true
       
       async 
          function A(){}
       
       ----for  error tolerance 

   ### awaitInNonAsync 
       for support await/for-await-of  in function-without-async
       normally USELESS, just one special js-runtime need this