You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@ast-grep/napi

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

57

index.d.ts

@@ -6,5 +6,15 @@ /* tslint:disable */

export const enum FrontEndLanguage {
Html = 0,
JavaScript = 1,
Tsx = 2,
TypeScript = 3
}
export interface Pos {
row: number
col: number
/** line number starting from 1 */
line: number
/** column number starting from 1 */
column: number
/** byte offset of the position */
index: number
}

@@ -15,2 +25,7 @@ export interface Range {

}
export interface NapiConfig {
rule: any
constraints?: any
language?: FrontEndLanguage
}
export class SgNode {

@@ -26,5 +41,7 @@ range(): Range

follows(m: string): boolean
getMatch(m: string): SgNode | null
getMultipleMatches(m: string): Array<SgNode>
children(): Array<SgNode>
findByString(pattern: string): SgNode | null
findAll(pattern: string): Array<SgNode>
find(matcher: string | number | NapiConfig): SgNode | null
findAll(matcher: string | number | NapiConfig): Array<SgNode>
field(name: string): SgNode | null

@@ -39,9 +56,29 @@ parent(): SgNode | null

}
export type SgRoot = AstGrep
export class AstGrep {
static html(src: string): SgRoot
static js(src: string): SgRoot
static ts(src: string): SgRoot
static tsx(src: string): SgRoot
export class SgRoot {
root(): SgNode
}
export namespace html {
export function parse(src: string): SgRoot
export function kind(kindName: string): number
export function pattern(pattern: string): NapiConfig
}
export namespace js {
export function parse(src: string): SgRoot
export function kind(kindName: string): number
export function pattern(pattern: string): NapiConfig
}
export namespace jsx {
export function parse(src: string): SgRoot
export function kind(kindName: string): number
export function pattern(pattern: string): NapiConfig
}
export namespace ts {
export function parse(src: string): SgRoot
export function kind(kindName: string): number
export function pattern(pattern: string): NapiConfig
}
export namespace tsx {
export function parse(src: string): SgRoot
export function kind(kindName: string): number
export function pattern(pattern: string): NapiConfig
}

10

index.js

@@ -239,5 +239,11 @@ const { existsSync, readFileSync } = require('fs')

const { SgNode, AstGrep } = nativeBinding
const { FrontEndLanguage, SgNode, SgRoot, html, js, jsx, ts, tsx } = nativeBinding
module.exports.FrontEndLanguage = FrontEndLanguage
module.exports.SgNode = SgNode
module.exports.AstGrep = AstGrep
module.exports.SgRoot = SgRoot
module.exports.html = html
module.exports.js = js
module.exports.jsx = jsx
module.exports.ts = ts
module.exports.tsx = tsx
{
"name": "@ast-grep/napi",
"version": "0.1.4",
"version": "0.1.5",
"description": "Search and Rewrite code at large scale using precise AST pattern",
"main": "index.js",
"repository": "https://github.com/HerringtonDarkholme/ast-grep",
"repository": "https://github.com/ast-grep/ast-grep",
"license": "MIT",

@@ -67,9 +67,9 @@ "keywords": [

"optionalDependencies": {
"@ast-grep/napi-win32-x64-msvc": "0.1.4",
"@ast-grep/napi-darwin-x64": "0.1.4",
"@ast-grep/napi-linux-x64-gnu": "0.1.4",
"@ast-grep/napi-win32-ia32-msvc": "0.1.4",
"@ast-grep/napi-darwin-arm64": "0.1.4",
"@ast-grep/napi-win32-arm64-msvc": "0.1.4"
"@ast-grep/napi-win32-x64-msvc": "0.1.5",
"@ast-grep/napi-darwin-x64": "0.1.5",
"@ast-grep/napi-linux-x64-gnu": "0.1.5",
"@ast-grep/napi-win32-ia32-msvc": "0.1.5",
"@ast-grep/napi-darwin-arm64": "0.1.5",
"@ast-grep/napi-win32-arm64-msvc": "0.1.5"
}
}
# @ast-grep/napi
See https://github.com/HerringtonDarkholme/ast-grep
See https://github.com/ast-grep/ast-grep

@@ -5,0 +5,0 @@ ## Support matrix

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc