
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A 100% compliant, self-hosted typescript parser that emits an ESTree-compatible abstract syntax tree
A 100% compliant, self-hosted Typescript parser that emits an ESTree-compatible abstract syntax tree
npm install buntis --save-dev
Buntis generates AST according to ESTree AST format, and can be used to perform syntactic analysis (parsing) of a Javascript or Typescript program, and with ES2015 and later a JavaScript program can be either a script or a module. The same methods are used when parsing in Typescript mode - parseTSModule and parseTSScript.
The parse methods exposed by Buntis takes an optional options object which allows you to specify whether to parse in script mode (the default) or in module mode or Typescript mode.
This is the available options:
{
// Enabled directives
directives: false;
// Disable web compability
disableWebCompat: false;
// Enable React JSX parsing when set to `true`
jsx: false
// The flag to enable stage 3 support (ESNext)
next: false;
// The flag to enable line/column location information to each node
loc: false;
// The flag to attach raw property to each literal and identifier node
raw: false;
// The flag to allow return in the global scope
globalReturn: false;
// The flag to enable implied strict mode
impliedStrict: false;
// Enable comment extraction. Accepts **only** a function
onComment: function() {}
// Enable Typescript parsing
ts: false
// Adds a source attribute in every node’s loc object when the locations option is `true`
source: false;
}
Example usage:
import { parseTSScript } from './buntis';
parseTSScript('const f = function<T>(x?: T): T {}');
This will return when serialized in json:
{
"type": "Program",
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"kind": "const",
"declarations": [
{
"type": "VariableDeclarator",
"init": {
"type": "FunctionExpression",
"params": [
{
"type": "Identifier",
"name": "x",
"optional": true,
"typeAnnotation": {
"type": "TypeAnnotation",
"typeAnnotation": {
"type": "TypeReference",
"typeName": {
"type": "Identifier",
"name": "T"
},
"typeParameters": []
}
}
}
],
"body": {
"type": "BlockStatement",
"body": []
},
"async": false,
"generator": false,
"id": null,
"typeParameters": {
"type": "TypeParameterDeclaration",
"params": [
{
"type": "TypeParameter",
"name": {
"type": "Identifier",
"name": "T",
"optional": 0,
"typeAnnotation": []
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TypeAnnotation",
"typeAnnotation": {
"type": "TypeReference",
"typeName": {
"type": "Identifier",
"name": "T",
"optional": false,
"typeAnnotation": []
},
"typeParameters": []
}
},
"declare": false
},
"id": {
"type": "Identifier",
"name": "f",
"optional": false,
"typeAnnotation": []
},
"definite": false
}
]
}
]
}
FAQs
A 100% compliant, self-hosted typescript parser that emits an ESTree-compatible abstract syntax tree
The npm package buntis receives a total of 6,714 weekly downloads. As such, buntis popularity was classified as popular.
We found that buntis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.