unwrap-jsonp
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

unwrap-jsonp Travis CI Build Status

Unwrap the values in a JSONP function.

NPM Badge

Install

npm install unwrap-jsonp

Usage

const unwrapJsonp = require("unwrap-jsonp")
 
unwrapJsonp(`fn({a: "b"})`)
//=> {a: "b"}
 
unwrapJsonp(`fn("a", "b")`, {multiArgs: true})
//=> ["a", "b"]

API

unwrapJsonp(data, options?)

data

Type: string

The jsonp to parse.

options

Type: object

multiArgs

Type: boolean
Default: false

Return an array of the function arguments instead of just the first one.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i unwrap-jsonp

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.74 kB

    Total Files

    6

    Last publish

    Collaborators

    • richienb