Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including node-opkg with all npm packages installed. Try it out:

var nodeOpkg = require("node-opkg")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

node-opkg v0.5.0

A simple command-line wrapper around the openwrt `opkg` package manager.

node-opkg

A simple command-line wrapper around the openwrt opkg package manager.

Allows to usage with a Node API.

Information: https://wiki.openwrt.org/doc/techref/opkg

Installation

Available as npm module:

npm install node-opkg

Usage

All methods return Promises. Command line options can be defined in the following ways:

{forceDepends: null, V: 4}
[--force-depends, -V4]

You can also get the output streams via the options argument:

{
  forceDepends: null,
  _stdout: (stdout) => {},
  _stderr: (stderr) => {}
}

Functions

update ⇒ Promise

Update package lists (update)

ParamTypeDescription
[opts]Array | ObjectCommand-line options

upgrade ⇒ Promise

Upgrade package(s) (upgrade)

ParamTypeDescription
pkgString | Array.<String>Package(s)
[opts]Array | ObjectCommand-line options

install ⇒ Promise

Install package(s) (install)

ParamTypeDescription
pkgString | Array.<String>Package(s)
[opts]Array | ObjectCommand-line options

configure ⇒ Promise

Configure package(s) (configure)

ParamTypeDescription
pkgString | Array.<String>Package(s)
[opts]Array | ObjectCommand-line options

remove ⇒ Promise

Remove package(s) (remove)

ParamTypeDescription
pkgString | Array.<String>Package(s)
[opts]Array | ObjectCommand-line options

flag ⇒ Promise

Flag package(s) (flag)

ParamTypeDescription
flagStringFlag
pkgString | Array.<String>Package(s)
[opts]Array | ObjectCommand-line options

list ⇒ Promise

Lists packages (list)

ParamTypeDescription
listStringList type ('available', 'installed', 'upgradable')
[pkg]String | Array.<String>Argument for 'available'
[opts]Array | ObjectCommand-line options

listPackages ⇒ Promise

Lists available packages (list)

ParamTypeDescription
[pkg]String | Array.<String>Package name(s)
[opts]Array | ObjectCommand-line options

listPackages ⇒ Promise

Lists installed packages (list)

ParamTypeDescription
[opts]Array | ObjectCommand-line options

listPackages ⇒ Promise

Lists upgradable packages (list)

ParamTypeDescription
[opts]Array | ObjectCommand-line options

changedConffiles ⇒ Promise

Lists changed config files (list-changed-conffiles)

ParamTypeDescription
[opts]Array | ObjectCommand-line options

files ⇒ Promise

Shows package files (files)

ParamTypeDescription
pkgString | Array.<String>Package name(s)
[opts]Array | ObjectCommand-line options

status ⇒ Promise

Find package providing given file

ParamTypeDescription
qStringQuery
[opts]Array | ObjectCommand-line options

info ⇒ Promise

Shows package info (info)

ParamTypeDescription
pkgString | Array.<String>Package name(s)
[opts]Array | ObjectCommand-line options

status ⇒ Promise

Shows package status(es) (status)

ParamTypeDescription
[pkg]String | Array.<String>Package name(s)
[opts]Array | ObjectCommand-line options

find ⇒ Promise

Finds a package by query string

ParamTypeDescription
qStringQuery string

setExecPath

Sets the opkg executable path

ParamTypeDescription
pathStringPath to executable

Changelog

  • 0.5.0 - Initial release
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free