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

haste-server

v0.2.1

Published

A damn simple and pretty pastebin server.

Downloads

8

Readme

Haste paste!

A damn simple and pretty pastebin server.

Haste is an open-source pastebin software written in Node.js, which is easily installable in any network. It can be backed by either redis or filesystem, and has a very easy adapter interface for other stores. A publicly available version of the original Haste by John Crepezzi can be found at hastebin.com.

Major design objectives:

  • Be really pretty.
  • Be really simple.
  • Be easy to set up and use.

Using from a terminal

Haste can be used very well even from terminal. There are many Haste clients written in various languages:

Installation

From npm

npm install -g haste-server

Then you can run it with haste-server.

From repository

git clone https://github.com/jirutka/haste-server.git
cd haste-server
npm install

Then you can run it with npm start.

Settings

Settings are read from the configuration file specified by environment variable CONF (see below). This file is parsed as JSON5, so comments are valid here and keys may not be quoted.

Environment variables

  • CONF ... path of the configuration file (default: ./config.json5).
  • HOST ... the host the server listen on (default: localhost).
  • PORT ... the port the server listen on (default: 7777).

Key Generation

Phonetic

Attempts to generate phonetic keys, similar to pwgen.

{
  "type": "phonetic"
}

Random

Generates a random key.

{
  "type": "random",
  "keyspace": "abcdef"
}

The optional keySpace argument is a string of acceptable characters for the key.

Storage

File

To use file storage (the default) change the storage section in config.json5 to something like:

{
  "type": "file",
  "path": "./data"
}

Where path represents where you want the files stored.

Redis

To use redis storage you must install the redis package from npm:

npm install redis

Once you’ve done that, change storage to something like:

{
  "type": "redis",
  "host": "localhost",
  "port": 6379,
  "db": 2
}

You can also set an expire option to the number of seconds to expire keys in. This is off by default, but will constantly kick back expirations on each view or post.

All of which are optional except type with very logical default values.

Postgres

To use postgres storage you must install the pg package from npm:

npm install pg

Once you’ve done that, change storage to something like:

{
  "type": "postgres",
  "connectionUrl": "postgres://user:password@host:5432/database"
}

You can also just set the environment variable for DATABASE_URL to your database connection url.

You will have to manually add a table to your postgres database:

create table entries (
  id serial primary key,
  key varchar(255) not null,
  value text not null,
  expiration int,
  unique(key)
);

You can also set an expire option to the number of seconds to expire keys in. This is off by default, but will constantly kick back expirations on each view or post.

All of which are optional except type with very logical default values.

Memcached

To use memcached storage you must install the memcache package from npm:

npm install memcache

Once you’ve done that, change storage to something like:

{
  "type": "memcached",
  "host": "127.0.0.1",
  "port": 11211
}

You can also set an expire option to the number of seconds to expire keys in. This behaves just like the redis expirations, but does not push expirations forward on GETs.

All of which are optional except type with very logical default values.

Authors

License

This project is licensed under MIT License. For the full text of the license, see the LICENSE file.

Other components:

  • jQuery: MIT/GPL license
  • highlight.js: Copyright © 2006, Ivan Sagalaev
  • highlightjs-coffeescript: WTFPL - Copyright © 2011, Dmytrii Nagirniak