Skip to content

hollax/url-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Javascript utility to convert data to query string

Examples

Convert objects

const query = require('@hollax/url-query');
let data = { foo: 'bar' };

console.log(query(data)) //logs 'foo=bar'

Convert object with array

let data = { 
  name: 'Foo',
  age: 31,
  tags: ['bar', 'baz']
};

console.log(query(data)) //logs 'name=Foo&age=31&tags[0]=bar&tags[1]=baz'

About

Javascript utility to encode data for url

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published