You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@jsonurl/jsonurl

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonurl/jsonurl

JSON->URL defines a text format for the JSON data model suitable for use within a URL/URI (as described by RFC3986).

1.1.4
Source
npmnpm
Version published
Weekly downloads
7.8K
18.56%
Maintainers
1
Weekly downloads
 
Created
Source

JSON→URL

License: MIT NPM version CI Quality Gate Coverage Lines of Code Security Rating Vulnerabilities Maintainability Rating Known Vulnerabilities FOSSA Status Contributor Covenant project chat

About

RFC8259 describes the JSON data model and interchange format, which is widely used in application-level protocols including RESTful APIs. It is common for applications to request resources via the HTTP POST method, with JSON entities. However, POST is suboptimal for requests which do not modify a resource's state. JSON→URL defines a text format for the JSON data model suitable for use within a URL/URI.

Usage

JSON→URL is available as a commonjs module (suitable for use in Node), ES6 module, or a script that may be used directly in a browser.

NPM install

npm install @jsonurl/jsonurl --save

CJS

const JsonURL = require("@jsonurl/jsonurl");

ES6 (Node + Babel)

import JsonURL from "@jsonurl/jsonurl";

Browser script tag

<script
    src="https://cdn.jsdelivr.net/npm/@jsonurl/jsonurl@1.1.2"
    integrity="sha384-kjdLAXTSwonl867FqmglObjdk+qIgyew1EE+3wCpYsJOthDuugo4/9xKHPjicfDL"
    crossorigin="anonymous"></script>

The JavaScript API

Once included, the API is the same for all three.

let value = JsonURL.parse( "(Hello:World!)" );
let string = JsonURL.stringify( value );

There are options available, but that's all you need to get started.

JSON→URL has no runtime dependencies.

Security

The parser is designed to parse untrusted input. It supports limits on the number of parsed values and depth of nested arrays or objects. When the limit is exceeded an Error is thrown, and sane limit values are set by default.

License

FOSSA Status

Keywords

JSON->URL

FAQs

Package last updated on 09 Apr 2021

Did you know?

Socket

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.

Install

Related posts