Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
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:
{
and }
) replaced by parentheses ((
and )
)[
and ]
) replaced by (~
and )
'
) and escaped:
and comma ,
) replaced by tildes (~
)~
) at the very beginning.Property names and string values are escaped as follows:
_
), hyphen (-
) and dot (.
) are preserved.$
) is replaced by exclamation mark (!
)0xff
are encoded as *XX
0xff
are encoded as **XXXX
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 jsurl
This work is licensed under the MIT license.
FAQs
URL friendly JSON-like formatting and parsing
The npm package jsurl receives a total of 19,997 weekly downloads. As such, jsurl popularity was classified as popular.
We found that jsurl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.