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

@npm-wharf/cloud-archive

v2.0.2

Published

a library to handle backup to and restore from cloud vendor object stores (s3, gcs)

Downloads

21

Readme

cloud-archive

A module to help with the task of archiving data tarballed, gzipped data to an object store (GS or S3 now). Includes retrieval

Build Status Coverage Status

Environment

Endpoints and connection configuration are set via environment variables:

  • OBJECT_STORE - the object store where tasks and grafs are stored and retrieved from
  • FILE_NAME_FORMAT - uses templating to specify a pattern for creating tarball names. Tokens are escaped with {{ }}.
    • All dates and times for tokens are UTC
      • dateTime - provides date and time: mm_dd_yy_HH_MM_SS
      • date - provides date: mm_dd_yy
      • time - provides time: HH_MM_SS
  • FILE_PATTERNS - a comma delimited list of glob patterns to tar when creating a backup. defaults to **/*
  • BASE_PATH - defaults to the processes' path
  • DATA_PATH - a subfolder off the base path, defaults to archive
  • FILE_NAME - a default archive name to use when restoring rather than finding the most recent. Useful in cases where you want to restore from a known archive.

AWS:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

GS:

  • GS_PROJECT_ID
  • GS_USER_ID
  • GS_USER_KEY

Archive limitations:

  • DISCARD_AFTER - how many days to keep archives for before removing them
  • COLDLINE_AFTER - how many days before a file is moved to "cold storage" this is primarily offerred as a way to move unliked files into a cheaper tier of slower/low priority storage.

API

backupFrom([glob])

Backs up files from dataPath and can selectively filter for files using the optional glob argument.

Returns a promise that will resolve on success with the filename or reject with an error on failure.

restoreTo([fileName])

Download the latest (or optionally, a specific filename) to dataPath.

Returns a promise that will resolve on success with the full path and file listing or a reject with an error on failure.

On success, the resulting data structure looks like:

{
  path: '/full/path/to/files',
  files: [
    'file1.txt',
    'file2.txt',
    'file3.txt',
    'file4.txt'
  ]
}

TODO

  • GS_USER_KEY expects PEM, not JSON key