npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@botsfactory/json-tool

v0.0.18

Published

Tool to manage JSON files.

Downloads

54

Readme

⚠️ Under heavy development ⚠️

BotsFactory JSON-Tool

JSON-Tool is a simple JavaScript tool for JS Objects and JSON processing.
You can read, update, replace, delte and write JSON data.

Getting Started

These instructions will get you a copy of the JSON-Tool to use in your code.

Reference

The commands available are:

  • goToPositon(path, obj)

This method go to the path and return the contained object.

  • getJsonFile(path, file)

This method read a json file and return it as JS Object. Use '/' in the path to specify the rute.

  • getJsonFileSync(path, file)

This method read a json file and return it as JS Object (synchronously).

  • getArrayObjectFilered(json, path, obj)

This method return an array of objects filtered by json in array/object. You can search in the array directly if path is null.

  • addObjectToArray(path, obj, newObj)

This method add a new object to an array in a JS object. You can add new the object to the array directly if path is null.

  • updateValueInArray(filter, path, value, obj)

This method return the object updated with the new value.

  • updateObjectInArray(filter, path, newObj, jsonObj)

This method replace the object filtered for the new object.

  • replaceObject(path, newObj, obj)

This method replace an object for newObj in the specified path.

  • deleteObjectFromArray(filter, path, obj)

This method delete an object from an array in a JS object. 'obj' can be an JS object or directly an array.

  • saveArrayObject(path, file, arrayObject)

This method update the specified file with the information in the array object. The file is created if not exist.

  • addObjectToFile(obj, keyPath, file, filePath)

This method add an object to an array in a JSON file.

  • updateObjectInFile(filter, newObj, keyPath, file, filePath)

This method update specific object for an id in a JSON file.

  • updateValueInFile(filter, value, keyPath, file, filePath)

This method update specific value for a key in a JSON file.

  • deleteObjectFromFile(filter, keyPath, file, filePath)

This method delete specific object in a JSON file.

  • getObjectFromFile(filter, keyPath, file, filePath)

This method get specific object filtered from a JSON file.

  • replaceObjectInFile(newObj, keyPath, file, filePath)

This method replace an object in the specified path in a JSON file.

  • getFolderContent(path)

This method get all JSONs files in the folder and return each file in an JSONs array with the file name and content.

Note:

  1. Use dot notation to specify the path in the JSON.
  2. 'filter' parameter must be a valid json. It's used to filter the desired object.

Authors

BotsFactory

License

This project is licensed under the MIT License - see the LICENSE.md file for details.