Git Product home page Git Product logo

unipkg's Introduction

unipkg

Gitter chat Build Status 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).

unipkg's People

Contributors

frederickgeek8 avatar va2ron1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

va2ron1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.