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

@devinit/datahub-api

v1.0.6

Published

Apollo GraphQL server using webpack and typescript

Downloads

66

Readme

Data hub graphql-server

Build Status codecov Codacy Badge Dependency Status npm version

Graphql server for the data-hub application.

Dataware house & Github CMS integration

This project has a dataware house module thats responsible for getting data from the datawarehouse and merge it with refrence data from a github repo acting as a CMS. The github repo (cms) contains refrence files such as colors, country names etc.

This data is served over a graphql API.

Useful commands:

npm run build       - build the library files (Required for start:watch)
npm start           - Start the server
npm run dev         - Start the server in watchmode (Useful for development)
npm test            - run tests once
npm run deploy      - will deploy app to now.sh make sure you have the DB access credentials in your system env file eg .bash_profile

How to run it:

    npm install -g yarn # if you dont have yarn installed
    yarn # install dependencies
    ## development mode
    npm run dev
    ## run in production
    npm start

Development guidelines

  • When you install a new dependency add its types from definetly typed typescript incase it doesnt come with any

eg yarn add --dev @types/ramda

  • Whenever you change the .gql files run npm run gqlToTs so that resolvers and type definitions are generated for use in graphql

On data caching

Every new instance of this node app starts with a fresh LRUcache which will be populated by items that get requested through the lifecycle of the application.

The app also persists queries on each data requests and does pre-caching of these queries on app boot.

During development; inorder to keep having fresh data, every data request is added to a queue as it gets served from the cache. This queue is ran in the background and updates after an hour of the request with new data if any.

.cache file contains all the queries occuring in the life time of the app. Its in git history so that we can precache those queries on app boot. (TODO: Make this run in another process)

Deployment

We are currently test deploying with now and they freeze inactive normal deployments. In order to create a deployment that's always active consider scaling your deploy

now scale my-deployment-ntahoeato.now.sh 1

Notes

This repo is published to npm so that we can reuse its types

TODO

  • [ ] remove console.info & console.error and replace with function that logs to an info & error file
  • [ ] fix testing on travis
  • [ ] Make uid immutable for testing purposes
  • [ ] pull in di_id as id in sql queries
  • [ ] Perf: breakdown tabs data fetching function into individual functions