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

@micro-fleet/persistence

v2.4.0-rc1

Published

Provides base repository class and database connector that helps connect to database and map db tables to JS objects (ORM).

Downloads

44

Readme

Micro Fleet - Backend Persistence library

Belongs to Micro Fleet framework, provides base repository class with pre-implemented CRUD operations.

INSTALLATION

  • Stable version: npm i @micro-fleet/persistence
  • Edge (development) version: npm i git://github.com/gennovative/micro-fleet-persistence.git

DEVELOPMENT

TRANSPILE CODE

  • Install packages in peerDependencies section with command npm i --no-save {package name}@{version}. Or if you want to use directly neighbor packages, excute npm run linkPackages.
  • npm run build to transpile TypeScript then run unit tests (if any) (equiv. npm run compile + npm run test (if any)).
  • npm run compile: To transpile TypeScript into JavaScript.
  • npm run watch: To transpile without running unit tests, then watch for changes in *.ts files and re-transpile on save.
  • npm run test: To run unit tests.
    • After tests finish, open file /coverage/index.html with a web browser to see the code coverage report which is mapped to TypeScript code.

CREATE UNIT TEST DATABASE

  • One of the quickest ways to set up the test environment is to use Docker:

    docker run -d --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:9.6-alpine

  • Create a database name unittest-persistence. If you want to change the name as well as database credentials, edit file /src/test/database-details.ts then execute npm run compile.

  • Install knex globally: npm i -g knex

  • Jump to database migration folder: cd database

  • Execute: knex migrate:latest

  • Note:

    • Existing tables are dropped.
    • If you want to re-run migration script, truncate all rows in knex_migrations table in database.

RELEASE

  • npm run release: To transpile and create app.d.ts definition file.
  • Note: Please commit transpiled code in folder dist and definition file app.d.ts relevant to the TypeScript version.