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 🙏

© 2026 – Pkg Stats / Ryan Hefner

solidify.js

v0.1.0

Published

Solidify: Fast, solid, and seamless. Your all-in-one Node.js framework for CLI, ORM, REST, and GraphQL.

Readme

Solidify

Solidify is a powerful and flexible web server framework for Node.js. It's built on top of industry-leading libraries like Fastify for performance, Objection.js for a powerful query builder and ORM, and Mercurius for seamless GraphQL integration.

Solidify helps you build robust and scalable APIs by providing a solid foundation with sensible defaults and a convention-over-configuration approach.

Features

  • All-in-One Solution: From command-line interfaces to database management and API serving, Solidify provides a seamlessly integrated toolkit.
  • Fast & Performant: Built on Fastify, one of the fastest web frameworks for Node.js, ensuring top-tier performance for your applications.
  • Solid & Declarative Models: Leverages Objection.js for a powerful and flexible ORM. Define your models, validations (via Yup), and relations in one clear, stable structure.
  • Effortless REST & GraphQL APIs: Automatically generate full CRUD RESTful endpoints and a complete GraphQL schema from your models, saving you time and effort.
  • Command-Line Ready: Integrates with commander.js to easily build powerful command-line tools alongside your web services.
  • Database Migrations: Includes helpers to create and manage your database schema directly from your model definitions, ensuring your database is always in sync.

Installation

npm install solidify.js

You will also need to install the database driver of your choice (e.g., pg, mysql2, sqlite3).

Quick Start

Here's a quick example of how to create a simple web server with a RESTful API for a User model.

1. Define a Model

Create a User.mjs model file. Solidify extends Objection.js models with extra capabilities.

// models/User.mjs
import { Model } from "solidify.js";

export class User extends Model {
  static tableName = "users";

  static fields = {
    id: {
      type: "increments",
      constraints: { primary: true },
      graphql: { type: "ID" },
    },
    name: {
      type: "string",
      constraints: { notNullable: true },
      validator: { min: 3 },
    },
    email: {
      type: "string",
      constraints: { unique: true, notNullable: true },
      validator: { email: true },
    },
    createdAt: {
      type: "timestamp",
      timestamp: "insert",
      graphql: { type: "DateTime" },
    },
  };
}

2. Create a RESTful Router

Create a routes/users.mjs file to define the API endpoints.

// routes/users.mjs
import { RESTfulRouter } from "solidify";
import { User } from "../models/User.mjs";

const router = new RESTfulRouter(User);

// This will automatically create the following routes:
// GET /users
// POST /users
// GET /users/:id
// PATCH /users/:id
// DELETE /users/:id
router.crud();

export default router;

3. Start the Web Server

Create a server.mjs file to put everything together.

// server.mjs
import { WebServer, Model } from "solidify";
import Knex from "knex";
import userRoutes from "./routes/users.mjs";

// 1. Initialize Database Connection
const knex = Knex({
  client: "sqlite3",
  connection: {
    filename: "./mydb.sqlite",
  },
  useNullAsDefault: true,
});
Model.knex(knex);

// 2. Create Server Instance
const server = new WebServer({
  logger: true,
});

// 3. Register Routes
server.register(userRoutes.plugin());

// 4. Start Server
const start = async () => {
  try {
    await server.listen({ port: 3000 });
  } catch (err) {
    server.log.error(err);
    process.exit(1);
  }
};

start();

Now you have a fully functional REST API for users!

Add GraphQL in One Go

Solidify can automatically generate a GraphQL schema from your models. Just add the graphql plugin:

// server.mjs (continued)
import { graphql, model, presets } from "solidify";
import { User } from "./models/User.mjs";

server.register(graphql.plugin({
  typeDefs: `
    type Query {
      users: [User!]!
    }
  `,
  resolvers: {
    Query: {
      users: presets.search(User),
    },
  },
  graphiql: true,
}));

// Now you have a GraphQL endpoint at /graphql

Build CLI Commands

Easily create command-line tools for your application, like a database migration command.

// cli.mjs
import { Command, Model, knexMigration } from "solidify";
import { User } from "./models/User.mjs";
import Knex from "knex";

const command = new Command();

command
  .command("db:migrate")
  .description("Run database migrations")
  .action(async () => {
    // Initialize DB connection (same as in server.mjs)
    const knex = Knex({ client: "sqlite3", connection: { filename: "./mydb.sqlite" }, useNullAsDefault: true });
    Model.knex(knex);
    
    await knexMigration([User]);
    console.log("Migrations completed!");
    await knex.destroy();
  });

command.parse(process.argv);

Run it with node cli.mjs db:migrate.

Documentation

Full documentation is coming soon.

  • Models: Learn how to define fields, validations, and relations.
  • Routing: Dive deeper into the Router and RESTfulRouter.
  • GraphQL: Learn how to expose your API via GraphQL.
  • Deployment: Best practices for deploying a Solidify application.

Contributing

Contributions are welcome! Please read our CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details.