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

horpyrion

v0.35.0

Published

Persistent data manager for crm/cms systems. Create schemas with permissions and CRUD operations

Downloads

15

Readme

HORPYRION

Build Status Downloads Downloads NPM version

install

npm install horpyrion

about

Library to create schemas with permissions and CRUD operations

usage

import Horpyrion from "horpyrion";

create instance

let horpyrion = new Horpyrion({
connect
});

start syncing to database

horpyrion.connect(); //return promise

Contexts and Actions

Each action need to be preceded by setup contexts Contexts begins from some other contexts and leads to different actions and contexts

set user context

Specify user context. Next contexts and actions will be done with this user permissions. and this user will be the owner

  • begins from instance

There are two variants:

root user, it doesn't specify any user. this will make next actions with root/sudo permissions

horpyrion
  .setRootUser() 

specific user context:

horpyrion
  .setUser(<user id>)

create schema action

Creates new collection in database

  • begins from user context
userContext
  .createSchema(<unique schema name>)
  

Returns promise which resolves to schema

get schema list actions

get list of collection info based on query

  • begins from user context
userContext
.getSchemas(<query object>)

Returns promise which resolves to schema list

get schema actions

get collection info based on id

  • begins from user context
userContext
.getSchema(<schema id>)

Returns promise which resolves to schema

set schema context

Specify schema context. Next actions and context will be in relation to selected context

  • begins from user context
userContext
.setSchema(<schema id>)

create record action

Creates new record in specific collection in database

  • begins from schema context
schemaContext
  .createRecord(<data>)
  

Returns promise which resolves to record

update schema actions

update collection info

  • begins from schema context
schemaContext
.updateSchema(<schema name>)

Returns promise which resolves to updated schema

remove schema actions

  • begins from schema context
schemaContext
  .removeSchema()

Returns promise which resolves to true

get record list actions

get list of records in collection based on query

  • begins from schema context
schemaContext
.getRecords(<query object>)

Returns promise which resolves to record list

get record actions

get record in collection based on record id

  • begins from schema context
schemaContext
.getRecord(<record id>)

Returns promise which resolves to record

get schema data

get specific collection info

  • begins from schema context
schemaContext
  .getData()

Returns promise which resolves to schema

set schema record context

Specify schema record context. Next actions and contexts will be in relation to selected record

  • begins from schema context
schemaContext
.setRecord(<schema id>)

update record actions

update record info

  • begins from record context
recordContext
.updateRecord(<record data>)

Returns promise which resolves to true

remove schema actions

  • begins from record context
recordContext
  .removeRecord()

Returns promise which resolves to true

get record data

get specific record info

  • begins from record context
recordContext
  .getData()

Returns promise which resolves to record

set user schema context

Specify user schema context. Next actions and context will be in relation to selected user context

  • begins from user context
userContext
.setUserSchema()

create user action

Creates new user in database

  • begins from user schema context
userSchemaContext
  .createRecord(<data>)
  

Returns promise which resolves to record

get user list actions

get list of users based on query

  • begins from user schema context
userSchemaContext
  .getRecords(<query object>)

Returns promise which resolves to user list

set user record context

Specify user record context. Next actions and contexts will be in relation to selected record

  • begins from user schema context
userSchemaContext
.setRecord(user id>)

update user record actions

update record info

  • begins from user record context
userRecordContext
.updateRecord(<record data>)

Returns promise which resolves to true

remove user actions

  • begins from user record context
userRecordContext
  .removeRecord()

Returns promise which resolves to true

get user record data

get specific record info

  • begins from user record context
userRecordContext
  .getData()

Returns promise which resolves to user record

testing

localhost testing:

  1. install postgress
  2. create user "test"
  3. password "test"
  4. database "test"

docker testing

  • run:
docker-compose up --exit-code-from test

or

  • run:
bash docker-test.sh

License

MIT