Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Ever wanted to put json in a url and thought it was ugly? JSOUN (Javascript Object URL Notation) makes it slightly better
Ever wanted to put JSON in a url? It's ugly, right?
To make it slightly better, you can use JSOUN (Javascript Object URL Notation).
const jsoun = require('jsoun')
var obj = {
"store":{
"book":[
{
"category":"reference",
"author":"Nigel Rees",
"title":"Sayings of the Century",
"price":8.95
},
{
"category":"fiction",
"author":"Evelyn Waugh",
"title":"Sword of Honour",
"price":12.99
},
{
"category":"fiction",
"author":"J. R. R. Tolkien",
"title":"The Lord of the Rings",
"isbn":"0-395-19395-8",
"price":22.99
}
],
"bicycle":{
"color":"red",
"price":19.95
}
}
}
var compact = JSON.stringify(obj)
var jsoun = jsoun(compact)
var url1 = encodeURI(compact)
var url2 = encodeURI(jsoun)
console.log('Compact JSON:')
console.log(compact)
console.log(compact.length+' chars')
console.log('\nAfter URL Encode:')
console.log(url1)
console.log(url1.length+' chars')
console.log('\nJSOUN:')
console.log(jsoun)
console.log(jsoun.length+' chars')
console.log('\nAfter URL Encode:')
console.log(url2)
console.log(url2.length+' chars')
// Compact JSON:
// {"store":{"book":[{"category":"reference","author":"Nigel Rees","title":"Sayings of the Century","price":8.95},{"category":"fiction","author":"Evelyn Waugh","title":"Sword of Honour","price":12.99},{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}],"bicycle":{"color":"red","price":19.95}}}
// 360 chars
// After URL Encode:
// %7B%22store%22:%7B%22book%22:%5B%7B%22category%22:%22reference%22,%22author%22:%22Nigel%20Rees%22,%22title%22:%22Sayings%20of%20the%20Century%22,%22price%22:8.95%7D,%7B%22category%22:%22fiction%22,%22author%22:%22Evelyn%20Waugh%22,%22title%22:%22Sword%20of%20Honour%22,%22price%22:12.99%7D,%7B%22category%22:%22fiction%22,%22author%22:%22J.%20R.%20R.%20Tolkien%22,%22title%22:%22The%20Lord%20of%20the%20Rings%22,%22isbn%22:%220-395-19395-8%22,%22price%22:22.99%7D%5D,%22bicycle%22:%7B%22color%22:%22red%22,%22price%22:19.95%7D%7D%7D
// 532 chars
// Magic JSON:
// ('store':('book':~('category':'reference','author':'Nigel_Rees','title':'Sayings_of_the_Century','price':8.95),('category':'fiction','author':'Evelyn_Waugh','title':'Sword_of_Honour','price':12.99),('category':'fiction','author':'J._R._R._Tolkien','title':'The_Lord_of_the_Rings','isbn':'0-395-19395-8','price':22.99);,'bicycle':('color':'red','price':19.95)))
// 360 chars
// After URL Encode:
// ('store':('book':~('category':'reference','author':'Nigel_Rees','title':'Sayings_of_the_Century','price':8.95),('category':'fiction','author':'Evelyn_Waugh','title':'Sword_of_Honour','price':12.99),('category':'fiction','author':'J._R._R._Tolkien','title':'The_Lord_of_the_Rings','isbn':'0-395-19395-8','price':22.99);,'bicycle':('color':'red','price':19.95)))
// 360 chars
JSOUN is only 100% safe in the fragment part of the url, i.e. after the # delimiter.
FAQs
Ever wanted to put json in a url and thought it was ugly? JSOUN (Javascript Object URL Notation) makes it slightly better
The npm package jsoun receives a total of 9 weekly downloads. As such, jsoun popularity was classified as not popular.
We found that jsoun 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.