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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vlasky/quoted-printable

v3.2.1

Published

Fast, robust RFC 2045 (Quoted-Printable) and RFC 2047 (Q-Encoding) encoder/decoder for Buffers in pure Javascript with an optional C++ binding. A fork of @ronomon/quoted-printable that supports Node.js v12.

Downloads

52

Readme

quoted-printable

Fast, robust RFC 2045 (Quoted-Printable) and RFC 2047 (Q-Encoding) encoder/decoder for Buffers in pure Javascript with an optional C++ binding. Avoids intermediary string allocations and regular expressions. Reduces branching through the use of lookup tables. This is a fork of @ronomon/quoted-printable modified to support Node.js v12.

Installation

Linux, OS X

This will compile the native binding automatically:

npm install @vlasky/quoted-printable

Windows

This will skip compiling the native binding automatically:

npm install --ignore-scripts @vlasky/quoted-printable

Performance

           CPU: Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz
         Cores: 8
       Threads: 1

============================================================

        Encode: 32768 x 32 Bytes
    Javascript: Latency: 0.003ms Throughput: 8.59 MB/s
        Native: Latency: 0.003ms Throughput: 10.81 MB/s

        Encode: 8192 x 128 Bytes
    Javascript: Latency: 0.006ms Throughput: 19.42 MB/s
        Native: Latency: 0.003ms Throughput: 33.83 MB/s

        Encode: 2048 x 512 Bytes
    Javascript: Latency: 0.017ms Throughput: 28.34 MB/s
        Native: Latency: 0.008ms Throughput: 58.25 MB/s

        Encode: 512 x 2048 Bytes
    Javascript: Latency: 0.063ms Throughput: 31.78 MB/s
        Native: Latency: 0.025ms Throughput: 80.66 MB/s

        Encode: 128 x 8192 Bytes
    Javascript: Latency: 0.244ms Throughput: 33.83 MB/s
        Native: Latency: 0.091ms Throughput: 95.33 MB/s

        Encode: 32 x 32768 Bytes
    Javascript: Latency: 0.970ms Throughput: 33.83 MB/s
        Native: Latency: 0.352ms Throughput: 95.33 MB/s

============================================================

        Decode: 32768 x 32 Bytes
    Javascript: Latency: 0.003ms Throughput: 19.89 MB/s
        Native: Latency: 0.002ms Throughput: 25.34 MB/s

        Decode: 8192 x 128 Bytes
    Javascript: Latency: 0.005ms Throughput: 61.42 MB/s
        Native: Latency: 0.003ms Throughput: 90.99 MB/s

        Decode: 2048 x 512 Bytes
    Javascript: Latency: 0.011ms Throughput: 107.33 MB/s
        Native: Latency: 0.005ms Throughput: 205.72 MB/s

        Decode: 512 x 2048 Bytes
    Javascript: Latency: 0.037ms Throughput: 129.93 MB/s
        Native: Latency: 0.015ms Throughput: 308.59 MB/s

        Decode: 128 x 8192 Bytes
    Javascript: Latency: 0.148ms Throughput: 130.03 MB/s
        Native: Latency: 0.054ms Throughput: 352.93 MB/s

        Decode: 32 x 32768 Bytes
    Javascript: Latency: 0.575ms Throughput: 137.31 MB/s
        Native: Latency: 0.210ms Throughput: 353.07 MB/s

Native Binding (Optional)

The native binding will be installed automatically when installing @vlasky/quoted-printable without the --ignore-scripts argument. The Javascript binding will be used if the native binding could not be compiled or is not available. To compile the native binding manually after installing, install node-gyp globally:

sudo npm install node-gyp -g

Then build the binding from within the @vlasky/quoted-printable module directory:

cd node_modules/@vlasky/quoted-printable
node-gyp rebuild

Usage

Encoding

var QuotedPrintable = require('@vlasky/quoted-printable');
var string = ' = ';
var options = { qEncoding: false };
var buffer = Buffer.from(string, 'utf-8');
var bufferEncoded = QuotedPrintable.encode(buffer, options);
console.log(bufferEncoded.toString('ascii'));
// " =3D=20"

Decoding

var QuotedPrintable = require('@vlasky/quoted-printable');
var string = ' =3D=20';
var options = { qEncoding: false };
var bufferEncoded = Buffer.from(string, 'ascii');
var buffer = QuotedPrintable.decode(bufferEncoded, options);
console.log(buffer.toString('utf-8'));
// " = "

Tests

To test the native and Javascript bindings:

node test.js

Benchmark

To benchmark the native and Javascript bindings:

node benchmark.js