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

unipkg

v0.2.1

Published

Multi-platform implementation of dpkg

Downloads

92

Readme

unipkg

npm

Multi-platform implementation of dpkg (in Javascript) with a programming and command-line interface.

Requirements

All that is assumed that you are running a Node.js version that has not been marked as end-of-life.

The project depends on fs-extra, klaw, tmp, tar, all of which should be installed by NPM or Yarn when installing the package. This should in theory run on Windows, macOS, and Linux.

Installation

unipkg can be installed by either NPM or Yarn, however, for the average user unipkg can be globally installed (meaning the unipkg binaries and libraries are in your path) by running

npm install -g unipkg

or, of course, locally by running

npm install unipkg

Usage

unipkg has both a interface for Node.js as well as a command-line interface. The command line usage is as follows:

Usage: unipkg [options] [command]

Options:

  -V, --version                output the version number
  -h, --help                   output usage information

Commands:

  scan|s <directory>
      Implementation of the dpkg-scanpackages -m command.
  <directory> is the directory to be scanned for Debian packages (.deb files).
  these will be added to a Packages index file which will be output in the current
  directory.

  build|b <directory> [<out>]
      Implementation of the dpkg-deb -b command.
  <directory> is the well structured package folder which should
  contain both the DEBIAN folder and the data of the package.
  [<deb>] is the optional output filename and path of the resulting Debian
  format archive. It defaults to outputting a deb file in the current working
  directory using the standard Debian name scheme.

The following is boilerplate code for the Node.js interface. The Node.js interface has the same usage and parameters as the CLI. Each function will return a Promise.

const dpkg = require("unipkg");
const pkg = "path/to/repo/deb/root";
const repo = "path/to/repo"

dpkg.build(pkg).then(
  path => {
    console.log(`The Debian package ${path} has been successfully written.`);
  },
  err => {
    console.error(`Error: ${err}`);
  }
);

dpkg.scan(repo).then(
  path => {
    console.log(`Your repository has been successfully created.`);
  },
  err => {
    console.error(`Error: ${err}`);
  }
)

Contributing

Feel free to submit issues or pull requests to the repository. Before contributing, please read our Contributing Guide.

Related Readings

Related Software

Despite my best efforts to initially find alternative software before beginning development of this project, before publishing I found several alterative to this package. Honestly, if I had found these before probably would not have persued writing my own library for this.

  1. debpkg by xor-gate is a is a pure Go library to create Debian packages. It has zero dependencies to Debian. It is able to generate packages from Mac OS X, *BSD and Windows.
  2. dpkg-build by wr1241 seems to be a largely non-active repository, however, it provides much of the same functionality of this library's API (sans CLI).