Nectar of the Programming Masses

    @yo8568/query-stringify

    1.0.0 • Public • Published

    Query Stringify

    build

    A simple tool for combining some query parameters as a entire url string.

    Installation

    $ npm install @yo8568/query-stringify

    Usage

    parameters

      qs({ basePath, query, url, ignore  })

    @param {string} options.basePath - url

    @param {object} options.query - parameters, eg query = { limit: 20, accounts: ['123', '456'], breakdown: 'country' }

    @param {string} options.url - next page url [high priority]

    @param {array} options.ignore - ignore specfic fields

    import qs from 'query-stringify'
    
    qs({
        basePath: '/api/test',
        query: {
          user: [1234, 3456],
          business: '3333333',
          skip: 10,
          limit: 333
        },
        ignore: ['user']
      })
    
    // output: '/api/test?business=3333333&skip=10&limit=333'

    Run Test

    Test

      $ npm run test

    Converage

      $ npm run cov

    Licence

    MIT

    Install

    npm i @yo8568/query-stringify

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    6.81 kB

    Total Files

    11

    Last publish

    Collaborators

    • yo8568