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

structured

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

structured

Simple interface for checking structure of JS code against a template, backed by Esprima.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

structured.js is a Javascript library that provides a simple interface for static analysis of Javascript code, backed by the abstract syntax tree generated by Esprima. Structured.js works in-browser <script src='structured.js'></script>, or as a standalone npm module.

Examples

var structure = function structure() {
  var _ = _;
  if (_ % 2 == 1) {
    _ += 1;
  }
};
var code = "var a = 11; var b = 1; if (a % 2 == 1) { b += 1;}"
var result = Structured.match(structure, code); // true

Check out the test suite for more.

Demo

demo/demo.html provides a user interface to create and test wildcard structures. The demo page is a good way to get a feel for the analysis and generate QUnit tests.

Tests

Run structured.js tests with npm test or by opening browser-test/index.html.

Dependencies

Esprima and UnderscoreJS for the framework, QUnit for the test suite.

Keywords

FAQs

Package last updated on 11 Jul 2013

Did you know?

Socket

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.

Install

Related posts

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