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

nanopos

v0.1.6

Published

A simple Lightning point-of-sale system, powered by Lightning Charge.

Downloads

9

Readme

nanopos

npm release MIT license Pull Requests Welcome IRC

A simple Lightning :zap: point-of-sale system with a clean & minimal web UI.

  • Optimized for places selling fixed-price items (like coffee shops, falafel stands or barber shops), but also has an option for billing custom amounts.
  • Small codebase (~60 server-side LoC + ~70 client-side LoC), great starting point for developing your own Lightning Charge apps!

Powered by :zap: Lightning Charge.

See demo video here ➤

Setup

$ npm install -g nanopos

$ edit items.yaml # see file format below

$ nanopos --items-path items.yaml --charge-token mySecretToken --currency USD
HTTP server running on localhost:9116

Running with Docker

Nanopos includes a Dockerfile to allow for fast setup using a docker container based on node:carbon. To run from the container with port 9116 exposed, first setup Lightning Charge, then build the image with:

$ docker build -t elements_project/nanopos .

and then run with:

$ docker run -p9116:9116 -e CHARGE_URL=http://[charge-url]/ -e CHARGE_TOKEN=[access-token] elements_project/nanopos

That's it! The web server should now be running on port 9116 and ready to accept payments.

Example items.yaml file

tea:
  price: 0.02 # denominated in the currency specified by --currency
  title: Green Tea # title is optional, defaults to the key

coffee:
  price: 1

bamba:
  price: 3

beer:
  price: 7

hat:
  price: 15

tshirt (S):
  price: 25
  metadata:
    shirt_size: S

The metadata object will be added into the metadata of invoices for this item.

CLI options

$ nanopos --help

  A simple Lightning point-of-sale system, powered by Lightning Charge.

  Usage
    $ nanopos [options]

  Options
    -c, --charge-url <url>      lightning charge server url [default: http://localhost:9112]
    -t, --charge-token <token>  lightning charge access token [required]

    -y, --items-path <path>     path to yaml file with item config [default: ./items.yaml, file is required]
    -x, --currency <currency>   currency to use for item prices [default: BTC]
    -m, --theme <name>          pick theme from bootswatch.com [default: yeti]
    -l, --title <name>          website title [default: Lightning Nano POS]
    --no-custom                 disable custom amount field [default: false]
    --show-bolt11               display bolt11 as text and button [default: false]

    -p, --port <port>           http server port [default: 9115]
    -i, --host <host>           http server listen address [default: 127.0.0.1]
    -h, --help                  output usage information
    -v, --version               output version number

  Example
    $ nanopos -t chargeSecretToken -x EUR -y items.yaml

License

MIT