trae-query

0.1.1 • Public • Published

query stringer

XO code style

NPM

Build & parse query strings

install

npm i -S trae-query

and use it

import {buildQuery, parseQuery} from 'trae-query'
 
const {buildQuery, parseQuery} = require('trae-query')
 
const url = buildQuery('/api/posts', {
  foo: 'bar',
  q: 'my query'
})
 
console.log(url) // <-- /api/posts?foo=bar&q=my%20query
 
const query = parseQuery(url)
 
console.log(query) // <-- { foo: 'bar', q: 'my query' }

FAQ

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i trae-query

    Weekly Downloads

    8

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • ndelvalle
    • gillchristian