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

@croudtech/crn-url-remapper

v0.0.1

Published

Module to remap between CRNs to URLs

Downloads

3

Readme

CC-Node-Utils-CRN

Installation

Install the scoped package via the command line

via Yarn

yarn add @croudtech/cc-v3-base

via NPM

npm install @croudtech/cc-v3-base

Methods

These methods depend on valid SYSTEM_ID, INTERNAL_ROUTING_FORMAT and SERVICE_MAP variables being available in the environment.

publicUrlFromCrn

Builds a public url from a CRN string

Usage: publicUrlFromCrn(crnString)

CRN

croud-system-id:workflow-service:tasks:0c6b08f8-ed05-47ea-93a4-0f171fa9effb

URL

https://workflow-service.croudcontrol.com/tasks/0c6b08f8-ed05-47ea-93a4-0f171fa9effb

internalUrlFromCrn

Builds an internal kubernetes url from a CRN string (the path structure is definable in INTERNAL_ROUTING_FORMAT).

Usage: internalUrlFromCrn(crnString)

croud-system-id:workflow-service:tasks:0c6b08f8-ed05-47ea-93a4-0f171fa9effb

URL

http://workflow-service-django.v3-staging.svc.cluster.local/tasks/0c6b08f8-ed05-47ea-93a4-0f171fa9effb

createCrn

Creates a CRN using the SYSTEM_ID defined in the env and the following object structure.

Usage: createCrn(entityObject)

Object

[
    {
        entity: "files",
        id: 12345
    }
]

this will output a CRN ID:

croud-system-id:workflow-service:files:12345

multiple objects can be provided to specify nesting:

[
    {
        entity: "tasks",
        id: "0c6b08f8-ed05-47ea-93a4-0f171fa9effb"
    },
    {
        entity: "files",
        id: 12345
    }
]

croud-system-id:workflow-service:tasks:0c6b08f8-ed05-47ea-93a4-0f171fa9effb:files:12345

this of course, can in turn be converted to URLs using the methods described earlier.

appendEntity

This will add a systemId, entityId and public link to an entity. This method can take three arguments

  1. The entity itself. This must have an id property
  2. A string to describe the entity type. A future development will allow the entity to be a sequalize model and identify the model type automatically.
  3. An optional array of parent entity values. This is to allow for nesting entities in the CRN/link

Usage: appendEntity(entity, entityType, parentEntities)