npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vetodb

v1.2.0

Published

VetoDB is meant to provide programmers a quick and easy way to store data with the power of SQLite3. VetoDB offers both persistent storage and in-memory storage for testing. No need to download drivers either, VetoDB works out of the box as it stores data

Downloads

12

Readme

VetoDB Docs

VetoDB is an open sourced SQLite3 wrapper for nodejs. Great for developers needing basic storage requiring the power of SQL, but feel intimidated by the language. VetoDB has some great core features while remaining lightweight.

  • Persistent Storage - Data doesn't disappear
  • Beginner Friendly - Created for beginners learning about data storage, documentation is straightforward.
  • Querying - VetoDB allows basic queries, like matching certain values in columns,

Installation

You can install VetoDB using npm.

npm install vetodb

Example

// Import VetoDB library. Replace './VetoDB' with the actual path to your library
const VetoDB = require('./VetoDB');

// Initialize the client with in-memory storage
// The ":memory:" option tells SQLite to keep the database in RAM
// This is non-persistent; data will be lost when the script ends
const client = VetoDB.Client({ databasePath: ':memory:' });

// Function to create a table and perform various operations
const createUserTable = async () => {
    // Create a new table called 'users' with specified columns
    // If the table already exists, this won't overwrite it
    const users = await client.createTable('users', ['username TEXT', 'email TEXT', 'age INTEGER']);
    console.log('User table created.');

    // Insert a new row into the 'users' table
    const result = await users.insert({ username: 'john_doe', email: '[email protected]', age: 25 });
    console.log('Insert Result:', result);

    // Insert another row for demo
    await users.insert({ username: 'jane_doe', email: '[email protected]', age: 22 });

    // Select rows that match the condition (age = 25)
    const selectedUsers = await users.select({ age: 25 });
    console.log('Selected Users:', selectedUsers);

    // Fetch a single row by its ID
    const user = await users.fetch(1);
    console.log('Fetched User:', user);

    // Update a specific column (age) for a specific row
    if (user) {
        await user.set('age', 26);
        console.log('Age updated to 26.');
    }

    // Delete a row by its ID
    if (user) {
        await user.pop();
        console.log('User removed.');
    }
};

// Run the createUserTable function and catch any errors
createUserTable().catch(err => {
    console.error('Something went wrong:', err);
});