New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@achingbrain/follow-registry

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@achingbrain/follow-registry

npm registry follower

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

@achingbrain/follow-registry

Build Status Dependency Status

Follows the npm registry and yields change objects when new modules are published

Usage

const followRegistry = require('@achinbrain/follow-registry')

// All options are optional
const options = {
  // user agent used to request metadata etc
  ua: 'npm-registry-follower',

  // where to get the changes from
  replicator: 'https://replicate.npmjs.com/registry/_changes',

  // where to get module details from
  registry: 'https://registry.npmjs.com',

   // where to store the sequence file
  seqFile: '/tmp/registry-follow.seq',

  // how many sets of metadata to request concurrently
  concurrency: 50,

  // restart the feed if no changes are received for this long
  inactivityTimeout: 3600000,

  // how long to wait after inactivityTimeout
  inactivityBackoff: 5000,

  // how many times to try fetching module metadata
  metadataRetries: 5,

  // how long to wait between retries
  metadataRetryBackoff: 5000,

  // override which seq value to start streaming changes from
  since: undefined
}

for await (const { change, done } of followRegistry(options)) {
  //...do something with change
  console.info(`${change.name} was updated`)

  // signal we are done processing this change
  //
  // Important - if `done` is not called, the change will be
  // reprocessed the next time `followRegistry` is run
  await done()
}

Changes feed

Instead of using the "standard" feed, this pulls the feed and breaks up the data into usable bits:

{
    name: .. the module name
    versions: [ .. version info split into parts ..],
    tarballs: [ .. all of the tarball data (shasum and url) .. ],
    json: .. metadata retrieved from the registry
}

Acknowledgements

Forked from davglass/follow-registry.

FAQs

Package last updated on 27 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc