All Projects β†’ nettofarah β†’ json-crate

nettofarah / json-crate

Licence: MIT license
πŸ“¦ json-crate: a minimalistic promise-based json database

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to json-crate

selenium-auto-wait
Utility to automatically manage all web element waits and enables to write wait-free selenium tests.
Stars: ✭ 31 (+6.9%)
Mutual labels:  testing-tools
meteorman
A DDP client with GUI (The Postman for Meteor)
Stars: ✭ 51 (+75.86%)
Mutual labels:  testing-tools
ruby-dns-mock
DNS mock server written on πŸ’Ž Ruby. Mimic any DNS records for your test environment with fake DNS server.
Stars: ✭ 50 (+72.41%)
Mutual labels:  testing-tools
ark.db
Small and fast JSON database for Node and browser. πŸ˜‹
Stars: ✭ 65 (+124.14%)
Mutual labels:  json-database
SHAFT ENGINE
SHAFT is an MIT licensed test automation engine. Powered by best-in-class frameworks like Selenium WebDriver, Appium & RestAssured it provides a wizard-like syntax to increase productivity, and built-in wrappers to eliminate boilerplate code and to ensure your tests are extra stable and your results are extra reliable.
Stars: ✭ 170 (+486.21%)
Mutual labels:  testing-tools
scenarioo
Scenarioo Docu Viewer for Automated Documentation using UI/E2E-Tests
Stars: ✭ 62 (+113.79%)
Mutual labels:  testing-tools
oz
Oz is a behavioral web-ui testing framework developed to reduce test maintenance by using a predictive model rather than a scriptive model when writing tests.
Stars: ✭ 23 (-20.69%)
Mutual labels:  testing-tools
Boston-Icons
Boston is an exclusive icon theme inspired by functionalist design and a touch of early computer icons. The project is focused on elemental properties, basic shapes, a reduced color palette and visual hierarchy.
Stars: ✭ 106 (+265.52%)
Mutual labels:  minimalistic
vividus-starter
VIVIDUS-based test project template
Stars: ✭ 43 (+48.28%)
Mutual labels:  testing-tools
blackhole
Blackhole is an MTA written on top of asyncio, utilising async and await statements that dumps all mail it receives to /dev/null.
Stars: ✭ 61 (+110.34%)
Mutual labels:  testing-tools
ContractTestingBoilerplate
Contract Testing Boilerplate for the microservices developed using Spring Boot and Kafka in a maven multi-module project.
Stars: ✭ 36 (+24.14%)
Mutual labels:  testing-tools
peterthehan
My personal site and profile README.
Stars: ✭ 36 (+24.14%)
Mutual labels:  minimalistic
mock-hls-server
Fake a live/event HLS stream from a VOD one. Useful for testing. Supports looping.
Stars: ✭ 61 (+110.34%)
Mutual labels:  testing-tools
home-assistant-theme-outline
🎨 Home Assistant Theme: Outline
Stars: ✭ 20 (-31.03%)
Mutual labels:  minimalistic
pymongo inmemory
A mongo mocking library with an ephemeral MongoDB running in memory.
Stars: ✭ 25 (-13.79%)
Mutual labels:  testing-tools
Cakebase
Cakebase is an asynchronous json database for nodejs.
Stars: ✭ 28 (-3.45%)
Mutual labels:  json-database
awesome-cypress
πŸŽ‰ A curated list of awesome things related to Cypress
Stars: ✭ 274 (+844.83%)
Mutual labels:  testing-tools
DebugWindow
δΈ€δΈͺεœ¨ηœŸζœΊδΈŠζ΅‹θ―•ζ—Άζ–ΉδΎΏζŸ₯ηœ‹θΎ“ε‡Ίζ—₯εΏ—ηš„ε°ε·₯具。(A debug tool which helps you view the console logs on the device when you test you APP.)
Stars: ✭ 36 (+24.14%)
Mutual labels:  testing-tools
react-router-testing-utils
A collection of utilities to test React Router with React Testing Library (Work in progress 🚧)
Stars: ✭ 34 (+17.24%)
Mutual labels:  testing-tools
network image mock
Mock response for Image.network to help Flutter widget tests pass.
Stars: ✭ 22 (-24.14%)
Mutual labels:  testing-tools

json-crate

πŸ“¦ minimalistic promise-based json database

json-crate is a super simple json database for quick hacks or when you need to persist simple json files.

Features

  • Fetch specific properties from a JSON file
  • Write/Update properties to a JSON file

Installation

$ npm install json-crate

Usage

Given a JSON file:

{
  "bakery": {
    "bread": [
      "sourdough", "french baguette"
    ],
    "desert": [
      "blueberry muffins", "chocolate croissant"
    ]
  },
  "household": {
    "cleaning-products": {
      "dish-detergents": [
        "Method Dish Soap Lemon Mint", "Meyers Clean Day Liquid Dish Soap"
      ]
    }
  }
}

Reading JSON data

const { loadAt, writeAt } = require("json-crate")

// You can load a specific property
loadAt("./tmp/groceries.json", "bakery.bread").then(bread => {
  console.log(bread)
  // => ["sourdough", "french baguette"]
})

// Load an item in an array
loadAt("./tmp/groceries.json", "bakery.bread[1]").then(bread => {
  console.log(bread)
  // => "french baguette"
})

json-crate uses lodash"s object path notation to read and write nested properties in the json file.

Writing JSON data

You can create new nested properties or update existing ones using the same object notation as before.

writeAt("./tmp/groceries.json", "frozen.ice-cream", [
  "chocolate chip cookie",
  "french vanilla"
])

Will update our groceries.json file with:

{
  "bakery": {
    "bread": [
      "sourdough", "french baguette"
    ],
    "desert": [
      "blueberry muffins", "chocolate croissant"
    ]
  },
  "household": {
    "cleaning-products": {
      "dish-detergents": [
        "Method Dish Soap Lemon Mint", "Meyers Clean Day Liquid Dish Soap"
      ]
    }
  },
  "frozen": {
    "ice-cream": [
      "chocolate chip cookie",
      "french vanilla"
    ]
  }
}

Notes

You can think of json-crate as a couple of convenience wrappers for dealing with simple objects you may want to persist.

This library is not intended for production usage and does not provide any data consistency guarantees such as concurrent access, locking of any kind or indexing.

Some great use-cases for json-crate:

  • test fixtures
  • configuration files
  • managing environment variables

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nettofarah/json-crate. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Code of Conduct.

To run the specs check out the repo and follow these steps:

$ yarn install
$ yarn test

License

The module is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].