Nobody Pays (for) Magazines
    Wondering what’s next for npm?Check out our public roadmap! »

    es-serialize-json

    1.0.0 • Public • Published

    serializeJSON

    Turns a json into a url string.

    Usage

    import serializeJSON from './serializeJSON'
     
    const serializedJSON = serializeJSON({ ... });

    Example

    Input

    {
      'first level': {
        'second level json': {
          'third level': 'third level value'
        },
        'second level array': [
          'first value', 'second value', 'third value'
        ]
      }
    }
    

    Output

    first%20level[second%20level%20json][third%20level]=third%20level%20value&first%20level[second%20level%20array][0]=first%20value&first%20level[second%20level%20array][1]=second%20value&first%20level[second%20level%20array][2]=third%20value
    

    Tests

    Flow + Ava

    npm test
    

    Flow Type

    npm run flow
    

    Ava Unit Tests

    npm run ava
    

    Install

    npm i es-serialize-json

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar