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

draig-oag

v2.0.8

Published

Distribution of the openapitools openapi-generator with modified cli

Downloads

4

Readme

draig: database REST API interactive generator

What is DRAIG

DRAIG is a JS (NodeJS, ExpressJS, KnexJS, Objection.js) DB-backed microservice code generator derived from the excellent openapi-generator for DbC (Design by Contract or Contract Based Development). You provide or design a contract (API definition in YAML) and the generator generates, for you, the DB tables, a fake (seed) initial database and the glue code (side effects) for CRUD operations.

With some more work (i.e. if you provide KnexJS or Objection queries) you can have complex DB interactions exposed as microservices in minutes.

DRAIG works seamlessly with draig-car, a CLI and REPL tool to design the contract and the queries, generate the code test the API and much more without leaving the REPL or using a simple and readline-powered CLI.

Under the hood, draig-car uses docker (only in available in some target platforms) to pull, create and manage the database instances required to deploy the API in MySQL (MariaDB), PostgreSQL or Oracle in a transparent fashion. The queries and DB operations are DB independent, so you don't have to worry (although you want it to) about hosts, ports, admin users, etc. You can, however, use SQLite as the DB provider for testing or production use (if you dare) without the need for a docker container.

How to use

Run

> npm -g install draig-oag`

For development work on draig itself, clone this repo, cd to draig dir and then run:

> npm -g install

The local working copy of the repository will be then linked with your installation. Use it alone or with draig-car.

Using as standalone generator

This is a new modified distribution of openapi-generator. So, once installed, you only have to use it like this:

> openapi-generator generate -g draig <rest of params>

What's OpenAPI

The goal of OpenAPI is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection.

When properly described with OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, OpenAPI removes the guesswork in calling the service.

Check out OpenAPI-Spec for additional information about the OpenAPI project, including additional libraries with support for other languages and more.

How do debug openapi-generator output?

The following additional debug options are available for all codegen targets:

# -DdebugOpenAPI prints the OpenAPI Specification as interpreted by the codegen
# -DdebugModels prints models passed to the template engine
# -DdebugOperations prints operations passed to the template engine
# -DdebugSupportingFiles prints additional data passed to the template engine