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

wilcocrypt

v2.2.0

Published

A encrypting tool

Downloads

380

Readme

WilcoCrypt

js-semistandard-style

The master branch may be unstable during active development. For production use, always install from npm or use a tagged GitHub Release.

A simple, modern Node.js encryption library and CLI tool. AES-256-GCM, password-based key derivation via scrypt, optional gzip compression, and a streaming API for large files.


Features

  • AES-256-GCM authenticated encryption
  • scrypt key derivation with a random salt per encryption
  • Optional gzip compression before encryption
  • Streaming API for large files (encryptFileStream / decryptFileStream)
  • CLI with interactive password prompt
  • TypeScript types included
  • semistandard code style

Installation

npm install wilcocrypt

Requires Node.js 18 or later.


Quick Start

import wilcocrypt from 'wilcocrypt';

// Encrypt / decrypt a Buffer
const encrypted = wilcocrypt.encryptData(Buffer.from('Hello!'), 'my-password');
const decrypted = wilcocrypt.decryptData(encrypted, 'my-password');

// Encrypt a file → writes file.txt.enc
wilcocrypt.encryptFile('file.txt', 'my-password');

// Decrypt to Buffer
const buf = wilcocrypt.decryptFile('file.txt.enc', 'my-password');

// Decrypt directly to disk
wilcocrypt.decryptFile('file.txt.enc', 'my-password', 'output.txt');

// Stream API (memory-efficient for large files)
await wilcocrypt.encryptFileStream('big.zip', 'big.zip.enc', 'my-password');
await wilcocrypt.decryptFileStream('big.zip.enc', 'big.zip', 'my-password');

CLI

# Encrypt
wilcocrypt -e secret.txt
# → prompts for password, writes secret.txt.enc

# Decrypt to stdout
wilcocrypt -d secret.txt.enc

# Decrypt to a file
wilcocrypt -d secret.txt.enc -o secret.txt

See wilcocrypt --help for all options.


Binary Payload Format

[ HEADER (10) ] [ VERSION (dynamic) ] [ salt (16) ] [ iv (12) ] [ ciphertext ] [ authTag (16) ]

The auth tag is appended at the end for streaming compatibility. See DOCS.md for the full layout.

Note: The format changed in v2.2.0. Payloads from v2.1.x are not compatible.


Error Handling

All errors are instances of WilcoCryptError with a machine-readable code property.

import wilcocrypt from 'wilcocrypt';
const { WilcoCryptError } = wilcocrypt._;

try {
  wilcocrypt.decryptData(payload, 'wrong');
} catch (err) {
  if (err instanceof WilcoCryptError) {
    console.error(err.code);    // e.g. DECRYPTION_FAILED
    console.error(err.message);
  }
}

Common codes: WEAK_PASSWORD, INVALID_HEADER, VERSION_MISMATCH, DECRYPTION_FAILED, INVALID_FILE_EXTENSION.


Documentation

Full API reference, CLI docs, payload format, TypeScript usage, and security notes: DOCS.md

Changelog: CHANGELOG.md


License

Licensed under GPL-3.0-only.