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

setup-apt

v2.0.0

Published

Setup apt packages and repositories in Debian/Ubuntu-based distributions

Downloads

114

Readme

Setup apt packages and repositories in Debian/Ubuntu-based distributions

Install

npm install --save setup-apt

Usage

updateAptAlternatives (function)

Update the alternatives for a package

Parameters:

  • name (string) - The name of the package
  • path (string) - The path to the binary
  • priority (number) - The priority of the alternative (Defaults to 40)

returns: Promise

addUpdateAlternativesToRc (function)

Add the update-alternatives command to the rc file

Parameters:

  • name (string) - The name of the package
  • path (string) - The path to the binary
  • rcOptions (RcOptions) - The options for the rc file to add the update-alternatives command to
  • priority (number) - The priority of the alternative (Defaults to 40)

returns: Promise

getAptEnv (function)

Get the environment variables to use for the apt command

Parameters:

  • apt (string) - The apt command to use

returns: ProcessEnv

aptTimeout (variable)

The timeout to use for apt commands Wait up to 300 seconds if the apt-get lock is held

hasNala (function)

Check if nala is installed

returns: boolean

getApt (function)

Get the apt command to use If nala is installed, use that, otherwise use apt-get

returns: string

isAptPackInstalled (function)

Check if a package is installed

Parameters:

  • pack (string) - The package to check

returns: Promise

isAptPackRegexInstalled (function)

Check if a package matching a regexp is installed

Parameters:

  • regexp (string) - The regexp to check

returns: Promise

updatedRepos (variable)

updateAptRepos (function)

Update the apt repositories

Parameters:

  • apt (string) - The apt command to use (optional)

returns: void

updateAptReposMemoized (variable)

Update the apt repositories (memoized)

Parameters:

  • apt - The apt command to use (optional)

filterAndQualifyAptPackages (function)

Filter out the packages that are already installed and qualify the packages into a full package name/version

Parameters:

  • packages (AptPackage[])
  • apt (string)

returns: Promise<string[]>

qualifiedNeededAptPackage (function)

Qualify the package into full package name/version. If the package is not installed, return the full package name/version. If the package is already installed, return undefined

Parameters:

  • pack (AptPackage)
  • apt (string)

returns: Promise

initApt (function)

Install gnupg and certificates (usually missing from docker containers)

Parameters:

  • apt (string)

returns: Promise

initAptMemoized (variable)

Install gnupg and certificates (usually missing from docker containers) (memoized)

addAptRepository (function)

Parameters:

  • repo (string)
  • apt (string)

returns: Promise

installAddAptRepo (function)

Parameters:

  • apt (string)

returns: Promise

InstallationInfo (type)

The information about an installation result

AptPackage (type)

The information about an apt package

installAptPack (function)

Install a package using apt

Parameters:

  • packages (AptPackage[]) - The packages to install (name, and optional info like version and repositories)
  • update (boolean) - Whether to update the package list before installing (Defaults to false)

returns: Promise

await installAptPack([{ name: "ca-certificates" }, { name: "gnupg" }])
await installAptPack([
  {
    name: "gcc",
    version,
    repository: "ppa:ubuntu-toolchain-r/test",
    key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
  },
])

AddAptKeyOptions (type)

addAptKey (function)

Add an apt key

Parameters:

  • options (AddAptKeyOptions) - The options for adding the key

returns: Promise

await addAptKey({ key: "3B4FE6ACC0B21F32" fileName: "bazel-archive-keyring.gpg"})
await addAptKey({
  keyUrl: "https://bazel.build/bazel-release.pub.gpg",
  fileName: "bazel-archive-keyring.gpg",
})

defaultKeyStorePath (variable)

KeyServerOptions (type)

defaultKeyServer (variable)

addAptKeyViaServer (function)

Add an apt key via a keyserver

Parameters:

  • { key, keyServer = defaultKeyServer, fileName, keyStorePath = defaultKeyServer } (KeyServerOptions)

returns: Promise

KeyUrl (type)

addAptKeyViaURL (function)

Add an apt key via a download

Parameters:

  • options - The options for adding the key
  • { keyUrl, fileName, keyStorePath = defaultKeyStorePath } (KeyUrl)

returns: Promise

🤝 Contributing

You can sponsor my work here:

https://github.com/sponsors/aminya

Pull requests, issues and feature requests are welcome. See the Contributing guide.