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

dbyaml

v1.6.1

Published

dbyaml is a command line tool to build data access layer based on config yaml file and its name should be dbconfig.yaml.

Downloads

4

Readme

Introduction

dbyaml is a command line tool to build data access layer based on config yaml file and its name should be dbconfig.yaml.

dbyaml file example

DbConfig:
  Source: mongodb
  ConnectionStr: mongodb://localhost:27017/test

Entities:
  Person:
    Fields:
      - Name String
      - Age Number
      - SchoolId ref School

Dbconfig contains information for the database provider including :

Source

Database type you are using which is currently only mongodb that is supported in the future other types will be supported

ConnectionStr

Connection string for database

installPackages

If true then related packages to datasource will be installed otherwise it will not be installed

Entities

Entities contains information for the data access entities and each entity contains property called Fields which contains list of string representing properties of this entity with each one contains property name and property type which now can be either String,Number,Boolean, ref

After building your dbconfig.yaml file run following command

dbyaml 'path-to-dbyaml'

In case you havenot entered path to dbyaml , it will be cosidered current working directory

After you run following files will be generated :

DbStart.js :

It will contain start function which connects to database server

Also it will create folder called Entities and then for each entity it will create three files (assuming entity name is student):

StudentSchema.js :

Returns object with it properties feild names and values field types

StudentEntity.js :

Return class that its properties is based on object returned from StudentSchema

StudentContext.js :

Return class used for applying crud operations on Student entity

example folder shows how to use them