Gathering detailed insights and metrics for grud
Gathering detailed insights and metrics for grud
Gathering detailed insights and metrics for grud
Gathering detailed insights and metrics for grud
Create, read, update and delete your JSON data store in GitHub.
npm install grud
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
2,355
Last Day
2
Last Week
6
Last Month
24
Last Year
254
MIT License
5 Stars
32 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Dec 03, 2024
Minified
Minified + Gzipped
Latest Version
1.0.12
Package Id
grud@1.0.12
Unpacked Size
37.78 kB
Size
10.10 kB
File Count
13
NPM Version
8.1.0
Node Version
16.13.0
Cumulative downloads
Total Downloads
Last Day
100%
2
Compared to previous day
Last Week
0%
6
Compared to previous week
Last Month
-58.6%
24
Compared to previous month
Last Year
-7.3%
254
Compared to previous year
Simple JSON data store in GitHub with CRUD interface for React, Node, Electron and the browser.
grud is a convenient method of storing & performing read, update & delete operations on data without setting up a database server.
1npm install grud
To get started with grud, initialize the db
object by passing the required config.
1const Grud = require("grud"); 2 3let config = { 4 protocol: "https", //If not passed, defaults to 'https' 5 host: "api.github.com", //If not passed, defaults to 'api.github.com' | In case of Enterprise-GitHub e.g github.snapcircle.net. 6 pathPrefix: "", //Leave empty if you are using github.com | In case of Enterprise-GitHub e.g api/v3 7 owner: "username", //Your GitHub username 8 repo: "my-repo", //Your repository name where you'd like to have your JSON store hosted 9 path: "db.json", //Your data store file with .json extension 10 personalAccessToken: "xxxx", //Your personal-access-token with write access 11}; 12let db = new Grud(config);
Create your GitHub personal token from here.
And please note that grud will create a new JSON data store file as mentioned in the config
(db.json in our case) if the file is not found.
If the file exists, data shall get appended to the collection array.
The following query creates a single post
record in your JSON dataStore (db.json
).
1const data = { 2 author: "Anand", 3 title: "sunt aut facere repellat provident ", 4 body: "quia et suscipit\nsuscipit recusandae consequuntur ", 5}; 6const posts = await db.save(data);
The following query creates multiple post
records in your defined JSON datastore.
1const data = [ 2 { 3 author: "Sarath", 4 title: "sunt aut facere repellat provident ", 5 body: "quia et suscipit\nsuscipit recusandae consequuntur ", 6 }, 7 { 8 author: "Anand", 9 title: "qui est esse", 10 body: "est rerum tempore vitae\nsequi sint nihil", 11 }, 12]; 13const posts = await db.save(data);
The following query returns a single post
record by unique identifier or Id.
1const post = await db.find({ _id: "301b63faac384a31b3e785ebf40295e5" });
or
1const post = await db.find({ author: "Anand" });
The following query returns all posts
records.
1const posts = await db.find();
Update record by Id or unique identifier.
The following query finds the post
record and updates it.
1const posts = await db.update( 2 { _id: "301b63faac384a31b3e785ebf40295e5" }, 3 data 4);
or
const posts = await db.update({ author: "Anand" }, data);
The following query deletes a single post
record.
1await db.deleteOne({ _id: "301b63faac384a31b3e785ebf40295e5" });
or
1await db.deleteOne({ author: "Anand" });
TBA
1npm run test
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
grud came out from the frequent need of having a database for internal tooling purpose.
If your priority is to have secure/high-performance storage, you should stick to traditional databases like MongoDB.
👤 Anees Ahammed
Copyright © 2021 Anees Ahammed.
This project is MIT licensed.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
SAST tool detected: CodeQL
Details
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More