0.1.1 • Published 9 years ago

trae-query v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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