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

ksuid-cli

v1.1.0

Published

A CLI for dealing with KSUIDs

Downloads

228

Readme

ksuid-cli

A Command Line Interface for dealing with Segment's KSUIDs.

Uses Mark Wubben's KSUID node.js library.

Installation

$ npm install ksuid-cli

This package comes with a simple command-line tool ksuid. This tool can generate KSUIDs as well as inspect the internal components for debugging purposes.

Usage examples

Generate 4 KSUIDs

> ksuid -n 4
151zKb0yBE31siVu9GYmpi1vlfe
151zKUmtgUA8kRSgg5Q6tG6vqPx
151zKTalsFp5ddmaiEaXu7l3YTD
151zKUVLrYKQ1p6XNDRPIFbrN1w

Inspect the components of a KSUID

Using the inspect formatting on just 1 ksuid:

> ksuid -f inspect

REPRESENTATION:

  String: 151zOCJ2I9szGtX4VwDJjnmvrpZ
     Raw: 0793CB58A38B910C80235B72A6F6B5DF5CA3C929

COMPONENTS:

       Time: 2018-05-24T01:46:00.000Z
  Timestamp: 127126360
    Payload: A38B910C80235B72A6F6B5DF5CA3C929

Using the template formatting on 4 ksuid:

> ksuid -f template -t '{{ .Time }}: {{ .Payload }}' -n 4
2018-05-24T01:46:31.000Z: B34547537772BBC0E2F29CACFC0BB5C2
2018-05-24T01:46:31.000Z: 79A4B61465263502F6F6B3D686F3B48E
2018-05-24T01:46:31.000Z: DBBF7F076962352AD8D60D45A34F5499
2018-05-24T01:46:31.000Z: B00E173900EBB05D768CADF13C3583D0

Generate detailed versions of new KSUID

Generate a new KSUID with the corresponding time using the time formatting:

> ksuid -f time -v
151zVo4Jr8dajx0fqHWAPxDbHRs: 2018-05-24T01:47:01.000Z

Generate 4 new KSUID with details using template formatting:

> ksuid -f template -t '{ "timestamp": "{{ .Timestamp }}", "payload": "{{ .Payload }}", "ksuid": "{{.String}}"}' -n 4
{ "timestamp": "127126441", "payload": "AF7BF3D0DB709B7933AF1AE83FBF4FBA", "ksuid": "151zYNlpxMf7nbb8CikaE4SUPQw"}
{ "timestamp": "127126441", "payload": "6E92616BDA6CC1B983D238E496080BAC", "ksuid": "151zYLnLhlehuIEeodZLMQ41c4a"}
{ "timestamp": "127126441", "payload": "8D55A9221F760433347F2B08C597AF3F", "ksuid": "151zYMjOiZv7K8q4dEYYySDpyu7"}
{ "timestamp": "127126441", "payload": "22FB4CB82107AC16628F77F60A5BFFE0", "ksuid": "151zYJUiEi4iniicXeu9xShcm3c"}

Display the detailed version of a new KSUID:

> ksuid -f inspect

REPRESENTATION:

  String: 151zbEzzY29y1EMfAycgv4kZTod
     Raw: 0793CBC06EA61F24424C8C6ED6DD3C7540AB013F

COMPONENTS:

       Time: 2018-05-24T01:47:44.000Z
  Timestamp: 127126464
    Payload: 6EA61F24424C8C6ED6DD3C7540AB013F