Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

darken-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

darken-sdk

JavaScript SDK for Darken.sh, a universal patch/mirror/image/sync tool.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Darken SDK

Darken is a mirroring client. This JavaScript SDK is for developing apps that interact with Darken registries.

How it works

First, the patcher downloads a manifest describing all of the files to be synchronized. Then, it verifies whether the local copy of each file in the manifest has a hash that matches the hash in the manifest. For each file in the manifest that either does not exist locally or whose hash does not match, the patcher will download that file.

Usage

import { darken } from 'darken-sdk';

darken({
  // OPTIONAL: The path on the local filesystem to be synced with the repo.
  path: process.cwd(),

  // OPTIONAL: The Darken registry URL
  registry: 'https://darken.sh',

  // OPTIONAL: The name of the Darken repo to pull
  repo: '@stable/blank',

  // OPTIONAL: Callbacks to integrate with Darken internals
  telemetry: {
    onFile(name) {
      // Called for each file in the manifest immediately after reading its manifest entry.
    },

    onFileError(name, error) {
      // Called if there was an error downloading or writing a file in the manifest.
    },

    onFileReady(name) {
      // Called when a file exists locally and has a hash matching the hash in the manifest.
    },

    onFileUpdate(name) {
      // Called when a file in the manifest either does not exist locally or has a hash that does not match its hash in the manifest.
    },

    onFileUpdateProgress(name, bytesProgress, bytesTotal) {
      // Called when downloading a file whenever progress is made
    },

    onManifest() {
      // Called immediately upon receiving the manifest.
    },

    onManifestError(error) {
      // Called if there was an error reading or validating the manifest.
    }
  }
});

FAQs

Package last updated on 08 Jun 2021

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