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

mysql-schema-generator

v0.0.4

Published

Generate projects from mysql-schema JSON files

Readme

mysql-schema-generator

Generate projects from mysql-schema JSON files.

Installation

$ npm i -g mysql-schema-generator

Usage

CLI

This is an example that uses a configurations file for mysql-schema setup, from CLI:

mysql-schema-generator
  --schema-generation
  --schema-configurations database.configurations.js
  --schema-extensions database.extensions.js
  --schema-output database.schema.js
  --generator-schema database.schema.js
  --generator-directories ./templates
  --generator-output .

API

This is an example that uses programmatic variables for mysql-schema setup instead, from API:

require("mysql-schema-generator").generateProject({
	schemaGeneration: true,
	schemaUser: process.env.DB_USER,
	schemaPassword: process.env.DB_PASSWORD,
	schemaHost: process.env.DB_HOST,
	schemaPort: process.env.DB_PORT,
	schemaDatabase: process.env.DB_NAME,
	schemaExtensions: process.env.DB_EXTENSIONS,
	schemaOutput: __dirname + "/db1.schema.js",
	generatorSchema: __dirname + "/db1.schema.js",
	generatorDirectories: [],
	generatorOutput: __dirname + "/db1"
}).then(() => {
	console.log("[*] Project successfully generated!");
}).catch(console.log);

Documentation

This project is about some parameters (input) and some process, that generate some files that compose a project (output).

The parameters

The parameters started with schema are inherited from mysql-schema project.

The parameters started with generator are from this project.

  • generatorSchema: file where the schema is taken from.
  • generatorDirectories: paths to directories used as template.
  • generatorOutput: path to the directory where we will dump the generated files.

The process

For each generatorDirectories value, mysql-schema-generator will look for the next folders:

  • ${generatorDirectory}/callbacks-before
    • Functional sync/async modules called at the begining.
  • ${generatorDirectory}/files-to-override
    • Files that will be copied, overriding any prexistent file.
  • ${generatorDirectory}/files-to-create
    • Files that will be copied only if there was no previous file.
  • ${generatorDirectory}/templates-to-override
    • Templates that will be rendered, overriding any prexistent file.
  • ${generatorDirectory}/templates-to-create
    • Templates that will be rendered only if there was no previous file.
  • ${generatorDirectory}/callbacks-after
    • Functional sync/async modules called at the end.

This is the exact order in which these files are generated.

License

This project is under WTFPL or 'What The Fuck Public License', which means 'do whatever you want'.

Issues

Please, report issues or suggestions here.