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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsalta-node-sdk

v1.0.3

Published

Official Node.js SDK for Dsalta API - File hashing and verification service

Readme

Dsalta Node.js SDK

Official Node.js SDK for Dsalta API - File hashing and verification service.

Installation

npm install dsalta-node-sdk
# or
yarn add dsalta-node-sdk

Usage

JavaScript

const Dsalta = require("dsalta-node-sdk").default;

const dsalta = new Dsalta({
  apiKey: "your-api-key",
  baseUrl: "https://api.dsalta.com", // Required
  timeout: 5000 // Optional, defaults to 5000ms
});

async function example() {
  const result = await dsalta.hashFile("./document.pdf", {
    author: "John Doe",
    department: "Legal",
  });

  console.log("File:", result.file);
  console.log("File type:", result.fileType);
  console.log("Metadata:", result.data.metadata);
}

example();

TypeScript

import Dsalta from "dsalta-node-sdk";
import { FileMetadata } from "dsalta-node-sdk";

const dsalta = new Dsalta({
  apiKey: "your-api-key",
  baseUrl: "https://api.dsalta.com", // Required
  timeout: 5000 // Optional, defaults to 5000ms
});

async function example() {
  const metadata: FileMetadata = {
    author: "John Doe",
    department: "Legal",
  };

  const result = await dsalta.hashFile("./document.pdf", metadata);
  console.log("File:", result.file);
  console.log("File type:", result.fileType);
  console.log("Metadata:", result.data.metadata);
}

example();

API Reference

Constructor

new Dsalta(config: DsaltaConfig)

Configuration options:

  • apiKey (required): Your Dsalta API key
  • baseUrl (required): The base URL for the Dsalta API
  • timeout (optional): Request timeout in milliseconds (default: 5000)

Methods

hashFile(file, metadata?)

Hash a file with optional metadata.

Parameters:

  • file: File to hash (can be a file path string, Buffer, or ReadStream)
  • metadata (optional): Object containing metadata to attach to the hash

Returns: Promise

The response includes:

  • success: boolean indicating if the operation succeeded
  • file: Original File object
  • filename: Name of the processed file
  • fileType: MIME type of the file
  • timestamp: ISO timestamp of the operation
  • data: Contains hash and metadata (when success is true)
  • error: Contains error details (when success is false)

Example Response

Success case:

{
  success: true,
  timestamp: '2024-02-19T19:19:46.776Z',
  file: File,
  filename: 'document.pdf',
  fileType: 'application/pdf',
  data: {
    hash: 'abc123...',
    metadata: {
      author: 'John Doe',
      department: 'Legal'
    },
    base64File: 'base64EncodedContent...'
  }
}

Error case:

{
  success: false,
  timestamp: '2024-02-19T19:19:46.776Z',
  file: File,
  filename: 'document.pdf',
  fileType: 'application/pdf',
  error: {
    message: 'API authentication failed',
    status: 401,
    code: 'AUTH_ERROR'
  }
}

License

MIT