object-to-url-query
v1.0.1
Published
A utility library for converting objects to url queries
Downloads
6
Readme
object-to-url-query
Convert a javascript object to a url query
installation
npm install object-to-url-query
Usage
ES6
import objectToUrlQuery from 'object-to-url-query';
const objectQuery = {
name: 'Patrick',
age: 15,
skill: 'Software Enginner'
};
const urlQueryString = objectToUrlQuery(objectQuery);
console.log(urlQueryString); //'name=Patrick&age=15&skill=Software%20Enginner'
cjs
var objectToUrlQuery = require('./index');
var objectQuery = {
name: 'Patrick',
age: 15,
skill: 'Software Enginner'
};
var urlQueryString = objectToUrlQuery(objectQuery);
console.log(urlQueryString); //'name=Patrick&age=15&skill=Software%20Enginner'