Socket
Book a DemoInstallSign in
Socket

ruby_parser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ruby_parser

JS Ruby file parser

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

JS Ruby file parser

Simple class for parsing ruby files, getting their methods, arguments, comments and AST.

const ruby = require('ruby_parser');
const parserObj = new ruby();

const parsed = parserObj.parse({
    filePath: 'tests/test.rb',
    // rubyString: `i = 7` // you can use filePath or rubyString
});

const info = parserObj.getInfo();
const methods = parserObj.getMethods();
const comments = parserObj.getComments();
const ast = parserObj.getAst(); // also, parserObj.parse method returns the ast

Keywords

ruby

FAQs

Package last updated on 02 Nov 2022

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