1.0.23 • Published 8 months ago
nv-jsparser-helper v1.0.23
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