Skip to content

codenaz/object-to-url-query

Repository files navigation

object-to-url-query

Build Status

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'

About

Convert a javascript object to a url query

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published