
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
A lightweight, file-based JSON database powered by SuperJSON for Node.js (and compatible) runtimes. Perfect for prototyping, testing, and when you just need a simple persistent store without the overhead of a full database system.
A lightweight, file-based JSON database powered by SuperJSON for Node.js (and compatible) runtimes. Perfect for prototyping, testing, and when you just need a simple persistent store without the overhead of a full database system.
Because setting up databases for local development is complex and You Only Live Once!
YoloDbRepository
Install the package:
npm install -D yolodb
Example:
import { yolodb } from 'yolodb'
// Create a table with a primary key
const usersTable = yolodb<User>('full/path/to/users.json', 'id', [])
// Insert a record
usersTable.insert({
id: '1',
name: 'John Doe',
createdAt: new Date(),
})
// Find by ID
const user = usersTable.findById('1')
// Search with custom filter
const activeUsers = usersTable.search((user) => user.status === 'active')
🧪 Testing and Development
🎮 Small Applications
📚 Learning Best Practices
const table = yolodb<Record>(filePath, primaryKeyField, initialData)
// Basic CRUD
table.all() // Get all records
table.findById(id) // Find by primary key
table.findBy(field, value) // Find by field value
table.search(filterFn) // Custom search
table.insert(record) // Insert single record
table.insertMany(records) // Bulk insert
table.update(record) // Update record
table.updateMany(records) // Bulk update
table.delete(id) // Delete by id
table.deleteMany(ids) // Bulk delete
table.truncate() // Clear all records
interface UserRepository {
findByUsername(username: string): User | null
}
class MockedUserRepository extends YoloDbRepository<User> implements UserRepository {
constructor() {
super("users.json", "id");
}
// Implement interface methods here
}
// Your real repository would look like this:
class DrizzleUserRepository implements UserRepository { ... }
Use Type Definitions
interface User {
id: string
name: string
createdAt: Date
}
const usersTable = yolodb<User>('users.json', 'id', [])
Implement Repository Pattern
Handle Errors
try {
table.insert(record)
} catch (error) {
// Handle file system errors
}
Clean Up Data
// e.g. in your tests teardown
table.truncate()
Made with ❤️ for developers who know that sometimes, you just need a simple solution.
FAQs
A lightweight, file-based JSON database powered by SuperJSON for Node.js (and compatible) runtimes. Perfect for prototyping, testing, and when you just need a simple persistent store without the overhead of a full database system.
The npm package yolodb receives a total of 5 weekly downloads. As such, yolodb popularity was classified as not popular.
We found that yolodb demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.