You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

function-parser

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

function-parser

Safe function call parser

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Function call parser

Greenkeeper badge

NPM Version Build Status Test Coverage

High performace function call parser, parse text and call function with argument without eval

High perormance

Function parser is good for cases when you want to describe function calls without the string overheads of json.

Simple to use

Using Javascript

  //Require all Function parser module
  const FunctionParser = require('function-parser');
  
  //Or Directly load the desired `parse`
  const {parse} = require('function-parser');

  //Simple usage
  parse('foo(1,"bar");foo(,"bar")')
  /*=> [
  {
    name: "foo",
    args: [
      1,
      "bar"
    ]
  },
  {
    name: "foo",
    args: [
      null,
      "bar"
    ]
  }
]*/

Using TypeScript

  import {parse} from 'function-parser';

//Usage
  parse('test({"json works": "However, for best performance it is recommended not to use json"})')
  /*=> [
  {
    name: "test",
    args: [
     {
        "json works": "However, for best performance it is recommended not to use json"
      }
    ]
  }
]*/

API

License

MIT

Keywords

parser

FAQs

Package last updated on 08 Dec 2018

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