Gathering detailed insights and metrics for @antoniosbarotsis/fake-db
Gathering detailed insights and metrics for @antoniosbarotsis/fake-db
Gathering detailed insights and metrics for @antoniosbarotsis/fake-db
Gathering detailed insights and metrics for @antoniosbarotsis/fake-db
npm install @antoniosbarotsis/fake-db
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
42 Commits
1 Watchers
1 Branches
1 Contributors
Updated on May 17, 2025
Latest Version
0.4.1
Package Id
@antoniosbarotsis/fake-db@0.4.1
Unpacked Size
12.49 kB
Size
4.61 kB
File Count
8
NPM Version
7.7.5
Node Version
15.4.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Fake-DB reads in a json file and automatically creates various endpoints on an express server. The point of this is for it to be used as an API mock to aid front-end development.
Install the package with npm i @antoniosbarotsis/fake-db
.
Make sure to create a data.json
file at the root of
your project.
To use it you just have to import it and run start()
1const db = require('@antoniosbarotsis/fake-db') 2 3db.start(8000) // Starts the server
Alternatively you can do the following:
1const { start } = require('@antoniosbarotsis/fake-db') 2 3start(8000)
The start
method takes in the port and filename as an arguments. If no port is specified then
process.env.PORT
will be used. If that is also undefined then 8000
will be picked. The default
file name is data.json
.
The package picks up the objects you input at the
data.json
file and automatically creates endpoints for them.
If we for example have the following in the file:
1{ 2 "users": [ 3 { 4 "name": "Tony" 5 } 6 ] 7}
Once we run the application endpoints will be generated under the
path http://localhost:8000/users
.
The file will be modified by now to this:
1{ 2 "users": [{ 3 "name": "Tony", 4 "id": 1 5 }], 6 "state": { 7 "users": { 8 "counter": 1 9 } 10 } 11}
You'll see that our user has a new generated id
attribute. In
addition a new state object has appeared which is used to keep track of
certain data that is neededbehind the scenes (as of now
it only keeps track of the counters needed
for id generation).
This might change in the future but for now for every entry in the json
file the following endpoints are created (using users
as an example):
In other words you can: Get all users, get a specific user by his id, add a new user (needs request body) update a user by id (also requires request body) and delete a user by id.
For now the PUT request needs all of the fields a user normally has (minus the id) but in the future that might change to any number of fields.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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