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

derpydb

v0.3.7

Published

DerpyDB are useful database for create database with some collums, some tables and more amazing function for easier for your work, if you want contact me come to Discord: Derpy#6666

Downloads

18

Readme

DerpyDB

Basic code

const Database = require('derpydb');
// SQlite
const db = new Database({ uri: 'sqlite://db.sqlite' });
// MySQL
const db = new Database({ uri: 'mysql://user:pass@host/dbname' });

new Database([options])

  • options.uri: specific uri to connect (default: sqlite://db.sqlite).

Creates a new database connection.

const db = new Database({ uri: "sqlite://db.sqlite" });

.createTable([options])

Get the data from given id or id and target

  • options.table: specific table name to create (default: main).
db.createTable({ table: 'players' }); // true

.get(id, [options])

Get the data from given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be get (default: null).
// without target
const data = db.get('derpy', { table: 'info' }); // { name: "Derpy", age: 19 }
// with target
const data = db.get('derpy', { table: 'info', target: 'age' }); // 18
const data = db.get('derpy.age', { table: 'players' }); // 18

.set(id, value, [options])

set new data to given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be set (default: null).
db.set('derpy.age', 20, { table: 'info' }); // 20

.has(id, [options])

find if the given id is exits

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to find (default: null).
db.has('derpy.age', { table: 'info' }); // true

.type(id, [options])

find the type of the given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to find type (default: null).
db.type('derpy.age', { table: 'info' }); // number

.startsWith(string, [options])

find the list datas that starts with the given string

  • options.table: specific table in the database (default: null).
db.startsWith('der', { table: 'info' }); // [{ id: 'derpy', value: { name: "Derpy", age: 19 }}]

.add(id, number, [options])

add number value to the given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be added the number (default: null).
db.add('derpy.age', 1, { table: 'info' }); // 20

.remove(id, number, [options])

remove number value from the given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be removed the number (default: null).
db.remove('derpy.age', 1, { table: 'info' }); // 18

.push(id, value, [options])

push new item value to the given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be pushed in to (default: null).
db.get('derpy.list', { table: 'info' }); // ['banana', 'grape']
db.push('derpy.list', 'apple', { table: 'info' }); // ['banana', 'grape', 'apple']

.pull(id, value, [options])

pull item value from the given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be pulled from it (default: null).
db.get('derpy.list', { table: 'info' }); // ['banana', 'grape', 'apple']
db.pull('derpy.list', 'grape', { table: 'info' }); // ['banana', 'apple']

.delete(id, [options])

delete value from the given id

  • options.table: specific table in the database (default: null).
  • options.target: specific a target to be deleted from it (default: null).
db.delete('derpy', { table: 'info' }); // true

.all([options])

get list of databases in specific table

  • options.table: specific table in the database (default: null).
db.all({ table: 'info' }); // [{ id: 'derpy', value: { name: 'Derpy', age: 19 }}]

.deleteAll([options])

delete all the databases from specific table

  • options.table: specific table in the database (default: null).
db.deleteAll({ table: 'info' }); // []

.tables()

get the list of the tables you created

db.tables(); // ['info']

.deleteTable([options])

delete specific table

  • options.table: specific table in the database (default: null).
db.deleteTable({ table: 'info' }); // true

.getTable([options])

get specific table information

  • options.table: specific table in the database (default: null).
db.getTable({ table: 'info' }); // { table: 'info', id: 'TEXT', value: 'TEXT' }

.db

run code through sqlite

db.db.prepare('SELECT * FROM info WHERE id = (?)').get('derpy')