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

edockit

v0.4.0

Published

A JavaScript library for listing, parsing, and verifying the contents and signatures of electronic documents (eDoc) and Associated Signature Containers (ASiC-E), supporting EU eIDAS standards for digital signatures and electronic seals.

Downloads

536

Readme

edockit

A JavaScript/TypeScript library for viewing and verifying EU standard ASiC-E containers, including Latvian eDoc files, which use the same format with a different extension. It works in both browser and Node.js environments.

Note: Work in progress. This library still needs broader real-world testing with ASiC-E implementations from more EU countries.

Installation

npm install edockit

If you implement trusted-list checking, TRUSTED-LIST.md is required reading. The README only covers the quick-start path.

Quick Start

import { parseEdoc, verifySignature } from "edockit";
import { createTrustListProvider } from "edockit/trusted-list";

const container = parseEdoc(fileBuffer);

const trustListProvider = createTrustListProvider({
  url: "/assets/trusted-list.json",
});

const result = await verifySignature(container.signatures[0], container.files, {
  includeChecklist: true,
  trustListProvider,
  revocationOptions: {
    proxyUrl: "https://cors-proxy.example.com/?url=",
  },
  trustedListFetchOptions: {
    proxyUrl: "https://cors-proxy.example.com/?url=",
  },
});

console.log(result.status, result.statusMessage);
console.log(
  result.checklist?.find((item) => item.check === "issuer_trusted_at_signing_time"),
);

Use revocationOptions.proxyUrl in browsers because OCSP and CRL endpoints usually do not support CORS. trustedListFetchOptions.proxyUrl is only needed if the verifier must fetch issuer certificates to strengthen trusted-list matching.

Verification Results

verifySignature() returns:

  • status: "VALID" | "INVALID" | "INDETERMINATE" | "UNSUPPORTED"
  • statusMessage: a human-readable explanation
  • checklist: optional structured verification steps when includeChecklist: true
  • trustListMatch: signer-issuer trust-list result when trustListProvider is configured
  • timestampTrustListMatch: timestamp-authority trust-list result when trustListProvider is configured

allowWeakDnOnlyTrustMatch is off by default, so DN-only trusted-list matches remain indeterminate.

Trusted List Setup

Recommended production path:

  1. Generate your own compact trusted-list bundle in CI or a build step.
  2. Host that JSON from your own app or CDN.
  3. Load it with createTrustListProvider({ url }).

Build-time generation uses the Node-only helper:

import { generateTrustedListBundle } from "edockit/trusted-list/build";

await generateTrustedListBundle({
  outputPath: "public/assets/trusted-list.json",
});

Runtime local matching uses:

import { createTrustListProvider } from "edockit/trusted-list";

Other opt-in trusted-list subpaths:

  • edockit/trusted-list/build: Node-only bundle generation helpers
  • edockit/trusted-list/http: tiny remote API wrapper
  • edockit/trusted-list/bundled: explicit bundled fallback snapshot

For proper trusted-list integration, remote API usage, hybrid local+remote setups, the provider contract, and bundle/manifest details, read TRUSTED-LIST.md.

Timestamp Utilities

The root package also exposes timestamp helpers:

import { getTimestampTime, parseTimestamp, verifyTimestamp } from "edockit";

Use these if you need direct RFC 3161 parsing or verification outside verifySignature().

Features

  • Parse ASiC-E containers, including Latvian .edoc
  • Verify XML signatures and signed file checksums
  • Validate signer certificates at the relevant signing time
  • Verify RFC 3161 timestamps
  • Check revocation for signer and TSA certificates
  • Return granular validation statuses instead of only boolean success/failure
  • Return a structured verification checklist for consumer applications
  • Match both signer issuers and timestamp authorities against a trusted list through an explicit provider contract

Compatibility

The library has been used in production to verify ASiC-E containers across a range of signature algorithms, certificate authorities, and vendor implementations.

If the library fails to parse a valid container or does not recognize a signature format, please open an issue or contact [email protected] and attach the sample file (if it does not contain sensitive or personal data). Real-world samples from other EU and non-EU countries are especially helpful.

Contributing

Contributions are welcome, especially:

  • real-world ASiC-E samples from different countries
  • bug reports with reproducible files when possible
  • interoperability fixes