Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
REPL playground for testing 0db.
This is a nodeJS REPL that comes with some handy context variables to easily play around with 0db on the command line.
npm i 0db-repl -g
Launch using:
0db
Type help()
to see a description of all available context variables.
Context variables are objects and functions that are already defined and available for usage during the REPL session.
$0db
0db object.
🎯 Example:
► const myDb = await $0db("my-db.json")
db
A default instance using the default file ./db.json
ready for use.
🎯 Example:
► await db("users").create({ name: "ambratolm" })
faker
Fake data generator to generate some realistic mock data. (See: Faker.JS)
🎯 Example:
► faker.name.firstName()
► faker.name.lastName()
► faker.name.gender()
► faker.internet.userName()
► faker.internet.email()
► faker.internet.password()
► await db("users").create({
name: faker.internet.userName(),
email: faker.internet.email(),
password: faker.internet.password()
})
gen
Built-in example data objects generator (using faker) that has some functions to generate example objects that can be added to database.
gen.user(count?)
: Generates user
objects.
count
: Number, Optional. Number of objects to generate. Default: 1.count <= 1
, else an array of objects.user
object is based on this schema:
{
name: String,
firstName: String,
lastName: String,
gender: String,
email: String,
password: String,
points: Number
}
🎯 Example:
► gen.user() // Returns 1 user object
► gen.user(100) // Returns an array of 100 user objects
► await db("users").create(gen.user())
gen.note(author?, count?)
: Generates note
objects.
author
: String, Optional. Identifier for the author of the note (Expected to be the $id
field of a created user
object that exists in database).count
: Number, Optional. Number of objects to generate. Default: 1.count <= 1
, else an array of objects.note
object is based on this schema:
{
author: String,
title: String,
content: String
}
🎯 Example:
► const user = await db("users").create(gen.user()) // Create a user item
► gen.note(user.$id) // Returns 1 note object
► gen.note(user.$id, 100) // Returns an array of 100 note objects
► const user = await db("users").create(gen.user())
► await db("notes").create(gen.note(user.$id))
cls
Clears screen.
🎯 Example:
► cls()
help
Shows a description of all context variables.
name
: String, Optional. Name of a specific context object or function to show description for.🎯 Example:
► help() // Shows all descriptions
► help("db") // Shows description only for "db" function
► help("gen") // Shows description only for "gen" object
Clone the repository.
cd somewhere
git clone https://github.com/practical-works/0db-repl.git
cd 0db-repl
Install dependencies: npm i
Run:
npm run dev
for development.npm start
for production.💡 In development, you can type rs
to manually restart. (See: Nodemon)
Licensed under MIT.
FAQs
0db REPL playground for testing 0db database.
The npm package 0db-repl receives a total of 0 weekly downloads. As such, 0db-repl popularity was classified as not popular.
We found that 0db-repl 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.