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

castborg

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

castborg

AST searcher and modifier

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

castborg

SourceCode

Represents code <--> AST Can be initialized with a code, an AST or a file path

// by code
var sourceCode = new SourceCode({ code: 'var obj = { a: 1, b: 2 };' });
// by AST
var sourceCode = new SourceCode({ ast: some_ast_object });
// by file
var sourceCode = new SourceCode({ file: './some-file.js' });

All source code instances have ast, code and filename properties

var ast       = sourceCode.ast;
var code      = sourceCode.code;
var file_name = sourceCode.file;

AstSearcher

AstSearcher has only static method that parse an AST and return a path


AstModifier

AstModifier has only static method that can modify an AST It will then return a new copy of the existing code / AST / filepath.

FAQs

Package last updated on 08 Apr 2015

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