Skip to content

object to uri string and uri string to object encode/decode

License

Notifications You must be signed in to change notification settings

magic-libraries/uri

Repository files navigation

@magic-libraries/uri

encode objects to uris and decode uri strings to objects

html-docs

@magic

NPM version Linux Build Status Windows Build Status Coverage Status Greenkeeper badge Known Vulnerabilities

installation

npm install --save-exact @magic-libraries/uri

usage

in a page/component, just use the lib.uri functions'),

encode
lib.uri.encode({
  host: 'https://example.com',
  params: {
    param_1: true,
    param_2: 'string',
  },
})

// returns
'https://example.com?param_1=true&param_2=string'
decode
lib.uri.decode('https://example.com?param_1=true&param_2=string')

// returns
{
  host: 'https://example.com',
  params: {
    param_1: true,
    param_2: 'string',
  },
}

changelog

0.0.1

first release

0.0.2

require node 13.5.0

0.0.3

bump required node version

0.0.4

bump required node version to 14.15.4

0.0.5

update dependencies

0.0.6 - unreleased

...

About

object to uri string and uri string to object encode/decode

Resources

License

Stars

Watchers

Forks

Packages

No packages published