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

libqp

v2.1.1

Published

Encode and decode quoted-printable strings according to rfc2045

Downloads

6,132,000

Readme

libqp

Encode and decode quoted-printable strings according to RFC2045.

Usage

Install with npm

npm install libqp

Require in your script

const libqp = require('libqp');

Encode values

Encode Buffer objects or unicode strings with

libqp.encode(val) → String

Where

  • val is a Buffer or an unicode string

Example

libqp.encode('jõgeva');
// j=C3=B5geva

Wrap encoded values

Quoted-Printable encoded lines are limited to 76 characters but encode method might return lines longer than the limit.

To enforce soft line breaks on lines longer than 76 (or any other length) characters, use wrap

libqp.wrap(str[, lineLength]) → String

Where

  • str is a Quoted-Printable encoded string
  • lineLength (defaults to 76) is the maximum allowed line length. Any longer line will be soft wrapped

Example

libqp.wrap('abc j=C3=B5geva', 10);
// abc j=\r\n
// =C3=B5geva

Transform Streams

libqp makes it possible to encode and decode streams with libqp.Encoder and libqp.Decoder constructors.

Encoder Stream

Create new Encoder Stream with

const encoder = new libqp.Encoder([options])

Where

  • options is the optional stream options object with an additional option lineLength if you want to use any other line length than the default 76 characters (or set to false to turn the soft wrapping off completely)

Example

The following example script reads in a file, encodes it to Quoted-Printable and saves the output to a file.

var libqp = require('libqp');
var fs = require('fs');
var source = fs.createReadStream('source.txt');
var encoded = fs.createReadStream('encoded.txt');
var encoder = new libqp.Encoder();

source.pipe(encoder).pipe(encoded);

Decoder Stream

Create new Decoder Stream with

const decoder = new libqp.Decoder([options])

Where

  • options is the optional stream options object

Example

The following example script reads in a file in Quoted-Printable encoding, decodes it and saves the output to a file.

const libqp = require('libqp');
const fs = require('fs');
let encoded = fs.createReadStream('encoded.txt');
let dest = fs.createReadStream('dest.txt');
let decoder = new libqp.Decoder();

encoded.pipe(decoder).pipe(dest);

License

MIT