corelink

0.0.2 • Public • Published

Utility for parsing an string in application/link-format into a JS Object.

Examples:

let links = "</1/101>,</1/102>,</2/0>,</2/1>,</2/2>,</3/0>,</5>"
let objects = parse(links);
let str = JSON.stringify(objects, null, '\t');
console.log(str);
//{
//	"1": [
//		"101",
//		"102"
//	],
//	"2": [
//		"0",
//		"1",
//		"2"
//	],
//	"3": [
//		"0"
//	],
//	"5": null
//}

links = "</3303/0/5700>,</3303/0/5701>,</3303/1/5603>"
objects = parse(links);
str = JSON.stringify(objects, null, '\t');
console.log(str);
//{
//	"3303": {
//		"0": [
//			"5700",
//			"5701"
//		],
//		"1": [
//			"5603"
//		]
//	}
//}

Readme

Keywords

Package Sidebar

Install

npm i corelink

Weekly Downloads

2

Version

0.0.2

License

ISC

Last publish

Collaborators

  • amorenoc