
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
JSCON is a Node.js library for working with JSON and JSCON files. It provides methods for parsing, writing, and sorting files, as well as other cool features!
To install JSCON, use the following command, make sure it is spelled jsccon JSCCON NOT JSCON:
npm install jsccon
parse(file) - Read .jscon file and convert to JavaScript object, the file is an jscon file, should look like <filename>.jsconsort(<file or url>, {by: "less|more", proprety: "<number property>", arrayProprety: "<array property>", output: "filename.jscon|object"}) Sort by property number or array values length where property is a number property and arrayProperty is an property that own arraymerge(outputFileName, [files]) Merge multiple files into one file, where outputFileName is the output file name, and [files] is array of file namesset(file, newData) Set a new object to the file, newData is objectdelete(file, {property: "property_name", value: "value"}) Delete an item from the file.update(file, {property: "property_name", value: "value", newData: {age: "18", job: "Playing video games all night"}}) Update the data who has the same property and value with and add the newData.Now. Let's say that's your json file:
[
{
"id": 1,
"name": "Alice",
"age": 25,
"pets": [
{
"name": "Fluffy",
"type": "cat"
},
{
"name": "Rover",
"type": "dog"
}
]
},
{
"id": 2,
"name": "Bob",
"age": 30,
"pets": [
{
"name": "Spot",
"type": "dog"
}
]
},
{
"id": 3,
"name": "Charlie",
"age": 20,
"pets": []
}
]
And that's how to use JSCON various functions to sort this JSON file:
// Require the library
const JSCON = require('jsccon');
const jscon = new JSCON();
// Parse a JSCON file
const data = jscon.parse('example.jscon');
console.log(data);
// Require the library
const JSCON = require('jsccon');
const jscon = new JSCON();
// Sort a .JSCON file by less
jscon.sort('example.jscon', { by: 'less', property: 'age', output: 'sorted_data.jscon' });
// Sort a .JSCON file by more
jscon.sort('example.jscon', { by: 'more', property: 'age', output: 'sorted_data.jscon' });
// Sort a .JSCON file by less values in array
jscon.sort('example.jscon', { by: 'less', arrayProperty: 'pets', output: 'sorted_data.jscon' });
// Sort a .JSCON file by more values in array
jscon.sort('example.jscon', { by: 'more', arrayProperty: 'age', output: 'sorted_data.jscon' });
// Sort a .JSCON file by less, but return data as object
jscon.sort('example.jscon', { by: 'less', property: 'age', output: 'object' });
// Require the library
const JSCON = require('jsccon');
const jscon = new JSCON();
// Merge multiple JSCON files
const inputFiles = ['file1.jscon', 'file2.jscon'];
jscon.merge('merged_data.jscon', inputFiles);
// Require the library
const JSCON = require('jsccon');
const jscon = new JSCON();
// Delete an item from a JSON file
jscon.delete('example.jscon', { property: 'name', value: 'Alice' });
// Require the library
const JSCON = require('jsccon');
const jscon = new JSCON();
// Add an item to a JSCON file
const newData = { name: 'Sarah', age: 28, pets: [] };
jscon.set('example.jscon', newData);
// Require the library
const JSCON = require('jsccon');
const jscon = new JSCON();
// Update an item in a JSCON file
const updatedData = { age: 26 };
jscon.update('example.json', { property: 'name', value: 'Bob', newData: updatedData });
JSCON is released under the MIT License. Read more
Contributions are welcome! If you have any suggestions, feature requests, or bug reports, please open an issue on the GitHub repository, also be free to send important bugs to my email adress
Credits goes to abdlmutii, if you like this npm package please remember to check other work i've done on github and star this repo.
FAQs
Json? come on, try jscon for more ✨ enhanced ✨ files.
We found that jsccon 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.