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

astq

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astq - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/astq.browser.js

4

bower.json
{
"name": "astq",
"version": "0.0.2",
"version": "0.0.3",
"description": "Abstract Syntax Tree (AST) Query Engine",
"main": "lib/astq.js",
"main": "lib/astq.browser.js",
"homepage": "https://github.com/rse/astq",

@@ -7,0 +7,0 @@ "license": "MIT",

@@ -38,14 +38,18 @@ /*

"gruntfile": [ "Gruntfile.js" ],
"astq": [ "src/**/*.js" ]
"astq": [ "src/**/*.js", "tst/**/*.js" ]
},
browserify: {
"astq": {
"astq-browser": {
files: {
"lib/astq.js": [ "src/**/*.js" ]
"lib/astq.browser.js": [ "src/**/*.js" ]
},
options: {
transform: [ "6to5ify", "pegjs-otf/transform", "browserify-shim" ],
transform: [
"6to5ify",
"pegjs-otf/transform"
],
plugin: [
[ "minifyify", { map: "astq.map", output: "lib/astq.map" } ],
[ "browserify-header" ]
[ "minifyify", { map: "astq.browser.map", output: "lib/astq.browser.map" } ],
"browserify-derequire",
"browserify-header"
],

@@ -57,2 +61,25 @@ browserifyOptions: {

}
},
"astq-node": {
files: {
"lib/astq.node.js": [ "src/**/*.js" ]
},
options: {
transform: [
"6to5ify",
"pegjs-otf/transform"
],
plugin: [
"browserify-header"
],
external: [
"pegjs-otf",
"pegjs-util",
"asty"
],
browserifyOptions: {
standalone: "ASTQ",
debug: false
}
}
}

@@ -77,4 +104,4 @@ },

grunt.registerTask("default", [ "jshint", "browserify" ]);
grunt.registerTask("test", [ "mochaTest" ]);
grunt.registerTask("test", [ "jshint:astq", "browserify:astq-node", "mochaTest" ]);
};
{
"name": "astq",
"version": "0.0.2",
"version": "0.0.3",
"description": "Abstract Syntax Tree (AST) Query Engine",
"keywords": [ "abstract", "syntax", "tree", "query", "engine", "adaptable" ],
"main": "lib/astq.js",
"main": "lib/astq.node.js",
"repository": {

@@ -25,3 +25,3 @@ "type": "git",

"pegjs-util": "~0.9.8",
"asty": "~0.9.7"
"asty": "~0.9.8"
},

@@ -40,7 +40,7 @@ "devDependencies": {

"browserify-shim": "~3.8.2",
"browserify-header": "~0.9.0"
"browserify-header": "~0.9.1",
"browserify-derequire": "~0.9.1"
},
"browserify-shim": {
"asty": "global:ASTY"
}
}

@@ -31,4 +31,6 @@

ASTq is a Abstract Syntax Tree (AST) query engine library for JavaScript,
i.e., it provides ...FIXME...
ASTq is a Abstract Syntax Tree (AST) query engine library for
JavaScript, i.e., it allows you to query nodes of an arbitary AST-style
hierarchical data structure with the help of a powerful XPath-inspired
query language.

@@ -35,0 +37,0 @@ Usage

@@ -25,9 +25,5 @@ /*

let stdfuncs = require("./astq-funcs-std.js")
class ASTQFuncs {
constructor () {
this._funcs = {}
for (let name in stdfuncs)
this.register(name, stdfuncs[name])
return this

@@ -34,0 +30,0 @@ }

@@ -25,6 +25,10 @@ /*

let ASTQAdapter = require("./astq-adapter.js")
let ASTQFuncs = require("./astq-funcs.js")
let ASTQCache = require("./astq-cache.js")
let ASTQQuery = require("./astq-query.js")
let ASTQAdapter = require("./astq-adapter.js")
let ASTQAdapterASTY = require("./astq-adapter-asty.js")
let ASTQAdapterMOZAST = require("./astq-adapter-xmldom.js")
let ASTQAdapterXMLDOM = require("./astq-adapter-xmldom.js")
let ASTQFuncs = require("./astq-funcs.js")
let ASTQFuncsSTD = require("./astq-funcs-std.js")
let ASTQCache = require("./astq-cache.js")
let ASTQQuery = require("./astq-query.js")

@@ -38,2 +42,7 @@ let ASTQ = class ASTQ {

this._cache = new ASTQCache()
this.adapter(ASTQAdapterASTY)
this.adapter(ASTQAdapterMOZAST)
this.adapter(ASTQAdapterXMLDOM)
for (let name in ASTQFuncsSTD)
this.func(name, ASTQFuncsSTD[name])
}

@@ -40,0 +49,0 @@ adapter (adapter) {

@@ -25,5 +25,9 @@ /*

/* global describe: true */
/* global it: true */
/* global expect: true */
describe("ASTq Library", function () {
it("basic functionality", function () {
var ASTQ = require("../src/astq.js");
var ASTQ = require("../lib/astq.node.js");
var astq = new ASTQ();

@@ -35,4 +39,2 @@ expect(astq).to.respondTo("adapter")

var ASTYA = require("../src/astq-adapter-asty.js");
astq.adapter(ASTYA)
astq.func("add", function (a, b) { return a + b })

@@ -39,0 +41,0 @@

@@ -25,7 +25,5 @@ /*

require("6to5/register");
/* global global: true */
/* global chai: true */
/* switch to strict mode */
"use strict";
/* provide exception swallowing */

@@ -32,0 +30,0 @@ global.swallow = function (thrower) { try { thrower(); } catch (e) {} };

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