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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hexo-db

v2.0.1

Published

An NPM Package helper to let you interact with your HexoShard database.

Downloads

23

Readme

hexo-db

An NPM Package helper to let you interact with your HexoShard database.

What is HexoDB?

An easy external database for your small projects, like Discord bots! HexoDB is:

  • Easy Connection
  • Simple
  • Fast read and writing data Read the full documentation below!

Getting Started

If you're interested to get your own database, you may visit our site by clicking here

Example

const Hexo = require("hexo-db");
const db = new Hexo.Database("https://db--username.repl.co")

db.set("foo", "bar")
.then(() => console.log("ID 'foo' is saved with the value 'bar'!"));

db.get("foo").then(data => {
  console.log(data) // Logs 'bar'
});

Built with

Authors

Fizx - Initial work - Fizuku

License

This project is licensed under the Apache License 2.0 - see LICENSE.md for details.

Support

You may join our server— FizxCreations - a server for all my creations!

Documentation

  • Base
const { Database } = require("hexo-db");
const hexoshard = "your-url-here"
const db = new Database(hexoshard);

Methods

.add (key, value)

Adds a number to a key with a number value.

  • key: string
  • value: number
db.add("coins", 200).then(() => console.log("Added 200 coins"));

.all ()

Returns an array of all data.

db.all() // -> [Array]

.delete (key)

Deletes the value of the specified key. Then returns boolean.

  • key: string
db.delete("foo").then(() => console.log("Deleted! :("));

.get (key)

Returns the data of the specified key. If no data is found, it will return null.

  • key: string
  • Alias: .fetch()
db.get("foo").then(data => console.log("value of 'foo' is " + data))

.has (key)

Returns true if the key exists and has a value, else false

  • key: string
  • Alias: .exists()
db.has("foo").then(data => console.log(data)) // -> true || false

.push (key, element)

Will push a string through an array, if the value of the key specified is also an array.

  • key: string
  • element: string
db.set("foo", ["bar"]) // -> ["bar"]
db.push("foo", "foo") // -> ["bar", "foo"]

.set (key, value)

This function sets new data based on a key in the database. (When using dot notation, if the object doesn't exist it'll create one)

  • key: string
  • value: number || object || string || array || boolean (default: null)
  • Alias: .write()
db.set("foo", "bar").then(() => console.log("'foo's value is now 'bar'!"))

.math (key, operand, value)

Performs an operation and sets it.

  • key: string
  • operand: /, +, *, -, "add", "plus", "subtract", "minus", "mul", "multiply", "div", "divide"
  • value: number
db.math("coins", "-", 30).then(() => console.log("Subtracted 30 coins"));

.subtract (key, value)

Subtracts a number from the specified key.

  • key: string
  • value: number
db.subtract("coins", 30).then(() => console.log("Subtracted 30 coins"));