
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
csv-database
Advanced tools
Lightweight CRUD database, using CSV as storage. Powered by Typescript + async/await.
Features :
> const db = await csvdb("users.csv", ["id","name","mail"]);
> await db.get({mail: "johndoe@github.com"});
[ {id: 1, name: "johndoe", mail: "john@github.com"} ]
> await db.add([{id: 2, name: "stevejobs", mail: "jobs@github.com"}]);
$ npm install csv-database
Promise<CsvDatabase>Returns a database, given a CSV file and its model.
; as default delimiter| Param | Type | Description |
|---|---|---|
| filename | string | csv file |
| model | string[] | database model |
| [optional] delimiter | string | custom delimiter |
Example
const db = await csvdb("users.csv", ["id","name","mail"], ",");
Promise<Object[]>Returns database content. If given a predicate, returns data that matches its key-values pairs.
| Param | Type | Description |
|---|---|---|
| [optional] predicate | Object.partial | search predicate |
Example
> await db.get();
[
{id: 1, name: "johndoe", mail: "john@github.com"},
{id: 2, name: "frankmass", mail: "frankmass@github.com"}
]
> await db.get({name: "johndoe"});
[ {id: 1, name: "johndoe", mail: "john@github.com"} ]
> await db.get({name: "stevejobs"});
[ ]
Promise<Object[]>Edits data, given a search predicate object.
| Param | Type | Description |
|---|---|---|
| predicate | Object.partial | search predicate |
| data | Object.partial | data that will replace found occurences key/values |
Example
> await db.edit({name: "johndoe"}, {mail: "john@gitlab.com"});
[{1, "johndoe", "john@gitlab.com"}]
Promise<Object[]>Adds data (single object or array) to CSV.
| Param | Type | Description |
|---|---|---|
| data | Object, Object[] | data to be added |
Example
> await db.add({id: 3, name: "stevejobs", mail: "jobs@github.com"});
[{id: 3, name: "stevejobs", mail: "jobs@github.com"}]
Promise<Object[]>Deletes all data that matches the given predicate.
| Param | Type | Description |
|---|---|---|
| predicate | Object.partial | search predicare |
Example
> await db.delete({id: 1});
[ {id: 1, name: "johndoe", mail: "john@github.com"} ]
Clone the project :
$ git clone https://github.com/ysnglt/node-csvdb
This project is made using Typescript. To generate the transpiled npm package, you need to run gulp :
$ gulp
You can run the full test suite with mocha :
$ npm i && npm run test
FAQs
lightweight CSV database
The npm package csv-database receives a total of 55 weekly downloads. As such, csv-database popularity was classified as not popular.
We found that csv-database 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.