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

bundle-registry-adaptor

v1.0.1

Published

service client to interact with Gliffy bundle registry

Downloads

6

Readme

Repository for the dynamodb centered bundle registry client. The client can be installed in any nodejs project using npm. The client provides functional api with the following methods:

Registry a new bundle for a front end resource. Returns a bundle object that includes an id (uuid) and created_at with time created

register(bundle)

bundle = {
    resourceName,  //namespace for the resource it will be a version of
    url, //location of the resource
    label //optional label to search bundle in registry
}

Get a bundle by id. Returns a bundle. Throws error if not found.

getBundle(id)

returns {
    id, //unique ID
    resourceName,  //namespace for the resource it will be a version of
    url, //location of the resource
    label, //optional label to search bundle in registry
    created_at //time the bundle was registered
}

Associates a bundle to an environment. An environment has 1 bundle of a resource

  • environment: name space defined by the application.
  • resourceName: resource bundle is a version of.
setEnvironmentResource(environment, resourceName)

Get the bundle of a resource associated with an environment.

environment: name space defined by the application. resourceName: resource bundle is a version of.

setEnvironmentResource(environment, resourceName)

return {
    id, //unique ID
    resourceName,  //namespace for the resource it will be a version of
    url, //location of the resource
    label, //optional label to search bundle in registry
    created_at //time the bundle was registered    
}

Get a list of the bundles (in descending order of creation time) for a specific resource with a specific label.

getLabel(resourceName, label)

returns [
    ...
    {
        items {
            id, //unique ID
            resourceName,  //namespace for the resource it will be a version of
            url, //location of the resource
            label, //optional label to search bundle in registry
            created_at //time the bundle was registered                
        }
    }
    ...
]

Get the bundle history of a resource

getBundleHistory(resourceName, options)

resourceName: name space of the resource
options : the following options are supported
             - limit: max number of bundles to retrieve
             - start: offset to get bundles from, use for pagination.  Assign start to the LastEvaluatedKey field returned from the previous request to getStableBundleHistory

returns [
    {
        items: {
            id, //unique ID
            resourceName,  //namespace for the resource it will be a version of
            url, //location of the resource
            label, //optional label to search bundle in registry
            created_at //time the bundle was registered                            
        },
        LastEvaluatedKey: LastEvaluatedKey
    }
]

Initialize the dynamodb tables if they do not exist.

initTables()

Development

Docker is needed for local development.

  • Run the local dynamodo container by running docker-compose up in the project root.
  • scripts/test-driver.js is a node script that will initialize the tables in local dynamodb, add a number of bundles and associations, and output the values. You can use the script to validate the adaptor methods against a real service.

Test

run npm test to execute the unit tests