| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
JSURL is an alternative to JSON + URL encoding (or JSON + base64 encoding). It makes it handy to pass complex values via URL query parameters.
JSURL has been designed to be:
Think of it as JSON with the following changes:
Property names and string values are escaped as follows:
JSON:
{"name":"John Doe","age":42,"children":["Mary","Bill"]}JSON + URL encoding:
%7B%22name%22%3A%22John%20Doe%22%2C%22age%22%3A42%2C%22children%22%3A%5B%22Mary%22%2C%22Bill%22%5D%7D
JSURL:
~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))
var JSURL = require("jsurl");
str = JSURL.stringify(obj);
obj = JSURL.parse(str);
// return def instead of throwing on error
obj = JSURL.tryParse(str[, def]);The easiest way to install jsurl is with NPM:
npm install jsurlThis work is licensed under the MIT license.
| Back | FazBrowse Home | New Git URL |