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

pixelletter

v0.1.4

Published

Node.js module to send real-world letters via pixelletter.de

Downloads

6

Readme

pixelletter

A node module to send letters via pixelletter.de for Node.JS. Supports current API version 1.3.

Features

  • Send letters from raw text
  • Send letters from file
  • Get current account balance
  • Cancel an existing order

Installing

npm install pixelletter --save

Usage

Load and configure as in the following example. Then use the provided functions as listed in the features section.

var pixelletter = require('pixelletter');

pixelletter.configure({
	email: '[email protected]',
	password: 'password',
	sandbox: true
});

Features

Following features are supported.

sendText()

You can send a letter from plain text as in the following example. Please note, that you can send paper letters aswell as fax messages. Use the action parameter to decide what you want to send:

action: pixelletter.LETTER; // send as paper
action: pixelletter.FAX; // send as fax
action: pixelletter.LETTER | pixelletter.FAX; // send both!

This is how to send a letter from plain text:

pixelletter.sendText({
	action: pixelletter.LETTER,
	fax: '+49 2222 1111111', // only if action FAX is selected
	address: 'Bob & Alice\n123 Some street\n8000 Somecity', // multi-line address
	subject: 'Hi Bob & Alice',
	message: 'How are you?',
	destination: 'DE', // defaults to DE but can be almost any country
	color: true, // print colored letters, default false
	green: true  // send co2 neutral, default false
}, function (err, id) {
	console.log(err);
	console.log(id); // logs the id that can be used to cancel a transaction
});

sendFile()

Sending a PDF or Word document is even easier.

pixelletter.sendFile({
	action: pixelletter.LETTER,
	file: './Test.pdf',
	color: true, // print colored letters, default false
	green: true  // send co2 neutral, default false
}, function (err, id) {
	console.log(err);
	console.log(id);
});

cancel()

You can cancel an transaction with the cancel() function. Here is an example.

pixelletter.sendFile({
	action: pixelletter.LETTER,
	file: './Test.pdf'
}, function (err, id) {
	pixelletter.cancel(id, function (error) {
		if(error)
			console.log(error);
	});
});

balance()

You can get your current account balance like this:

pixelletter.balance(function (err, balance) {
	console.log(balance);
});

Tests

No automated tests available but tested!

Unsupported

The following features are not yet supported, contributions very welcome!

  • Digital signatures
  • "Addoptions" like Nachnahme
  • Sending postcards
  • Setting an explicit return address
  • maybe something else?