Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ast-grep/napi

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ast-grep/napi - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

5

index.d.ts

@@ -10,3 +10,4 @@ /* tslint:disable */

Tsx = 2,
TypeScript = 3
Css = 3,
TypeScript = 4
}

@@ -30,2 +31,3 @@ export interface Pos {

}
export function parseFiles(paths: string[], callback: (err: null | Error, result: SgRoot) => void): Promise<unknown>
export class SgNode {

@@ -57,2 +59,3 @@ range(): Range

root(): SgNode
filename(): string
}

@@ -59,0 +62,0 @@ export namespace html {

15

index.js

@@ -14,3 +14,4 @@ const { existsSync, readFileSync } = require('fs')

try {
return readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
const lddPath = require('child_process').execSync('which ldd').toString().trim();
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {

@@ -105,2 +106,11 @@ return true

case 'darwin':
localFileExisted = existsSync(join(__dirname, 'ast-grep-napi.darwin-universal.node'))
try {
if (localFileExisted) {
nativeBinding = require('./ast-grep-napi.darwin-universal.node')
} else {
nativeBinding = require('@ast-grep/napi-darwin-universal')
}
break
} catch {}
switch (arch) {

@@ -241,3 +251,3 @@ case 'x64':

const { FrontEndLanguage, SgNode, SgRoot, html, js, jsx, ts, tsx } = nativeBinding
const { FrontEndLanguage, SgNode, SgRoot, parseFiles, html, js, jsx, ts, tsx } = nativeBinding

@@ -247,2 +257,3 @@ module.exports.FrontEndLanguage = FrontEndLanguage

module.exports.SgRoot = SgRoot
module.exports.parseFiles = parseFiles
module.exports.html = html

@@ -249,0 +260,0 @@ module.exports.js = js

{
"name": "@ast-grep/napi",
"version": "0.2.1",
"version": "0.2.2",
"description": "Search and Rewrite code at large scale using precise AST pattern",

@@ -46,3 +46,3 @@ "main": "index.js",

"devDependencies": {
"@napi-rs/cli": "2.14.3",
"@napi-rs/cli": "2.14.4",
"ava": "5.1.1",

@@ -68,9 +68,9 @@ "chalk": "5.2.0",

"optionalDependencies": {
"@ast-grep/napi-win32-x64-msvc": "0.2.1",
"@ast-grep/napi-darwin-x64": "0.2.1",
"@ast-grep/napi-linux-x64-gnu": "0.2.1",
"@ast-grep/napi-win32-ia32-msvc": "0.2.1",
"@ast-grep/napi-darwin-arm64": "0.2.1",
"@ast-grep/napi-win32-arm64-msvc": "0.2.1"
"@ast-grep/napi-win32-x64-msvc": "0.2.2",
"@ast-grep/napi-darwin-x64": "0.2.2",
"@ast-grep/napi-linux-x64-gnu": "0.2.2",
"@ast-grep/napi-win32-ia32-msvc": "0.2.2",
"@ast-grep/napi-darwin-arm64": "0.2.2",
"@ast-grep/napi-win32-arm64-msvc": "0.2.2"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc