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

@keeex/afterbc

v2.2.3

Published

Provide and parse string that indicate a "not before" date.

Downloads

8

Readme

@keeex/afterbc

Library that provide strings that could not have existed before the time of the call.

The first version is based on the Bitcoin blockchain and BlockCypher. It returns the last block hash value, providing a string that effectively could not be guessed beforehand.

This value, combined with proper timestamping that provide a "not after" date can provide a limited timeframe for the creation of any associated data.

Usage

The library exposes two functions as the default export. A quick example follows:

import {getAfterString, parseAfterString} from "@keeex/afterbc";

const main = async() => {
  const str = await getAfterString();
  // At this point the value of str can be embedded in any data to be
  // timestamped
  const ouptut = await parseAfterString(str);
  // output contains a `date` property that is a JavaScript Date
  console.log("Returned string date: ", output.date);
  // it also contains a `checkUrl` property that provides third-party
  // verification
  console.log("Check URL: ", output.checkUrl);
}

Restrictions

The output is limited to the resolution of the source. In this case, bitcoin blocks are only created once in a while.

The library manages a cache that should be acceptable for any given source. Multiple calls that uses the same source will use that cache and avoid hitting the underlying service.

In the future, this library might support multiple data providers; the output string is made in a way that allow transparent handling of these future sources. Any string produced in the past should be handled appropriately to some extent.

We currently depend on BlockCypher's API to provide this service.