You would have come acorss TypeError: Converting circular structure to JSON if you have been handling JSONs for a while now, circular-json serializes and deserializes otherwise valid JSON objects containing circular references into and from a specialized JSON format.
Get it:npm install circular-json
Sample usage:
1234567891011121314151617
'use strict';constCircularJSON=require('circular-json'),obj={foo:'bar'},str;obj.self=obj;conststr=CircularJSON.stringify(obj);// "{\"foo\":\"bar\",\"self\":\"~\"}"/*JSON.stringify(obj); would have resulted in:TypeError: Converting circular structure to JSON*/
jsvu makes it easy to fetch the latest versions of JavaScript engines for a specific OS, without the hassels of compiling them!
Get it:
1
npm install -g jsvu
12
# in your ~/*.rcexport PATH="${HOME}/.jsvu:${PATH}"
1
jsvu
It's prompts for the OS and the engine and install them based on your choice, it can install Chakra/ChakraCore, JavaScriptCore, SpiderMonk
ey and V8 for you.
{#commentsaretreatedlikewhitespace-theyarenotparsedhello:HelloHuman!// js style comment/* multiline comment multiline comment */#texttext:Thisisavalidstringvalue.quote:"You need quotes\tfor escapes"otherwise:<divclass="cool">lifewithoutescapesisbliss!</div>#keysabc-123:noquotesforkeys#commacommas:"can be omitted at the end of the line"but:[1,2,3]#notbetweenelementsonthesamelinetrailing:[1,2,3,]#atrailingcommaisOK#multilinestringmultiline:''' first line indented line third line '''#numbers,keywordsandarraysworkjustlikeinJSONnumber:5negative:-4.2yes:trueno:falsenull:nullarray:[1,2]array2:[12]}
This module makes use of webtorrent to implement an HTML element you can use to display content on WebTorrent.
Get it:npm install --save webtorrent-element
Sample usage:
1234567
// This gets bundled.constWebTorrentComponent=require('webtorrent-element');letelem=newWebTorrentComponent();elem.src=MAGNETURL;// MANGETURL to be viewed.elem.file='Sintel.mp4';// File in that torrent.document.body.appendChild(elem);