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

@locktech/docker-client

v1.42.0

Published

<div align="center"> <h1>🐳&nbsp;&nbsp;&nbsp;Docker Engine API Client</h1> <p>(a) NodeJS client for the <a href="https://docs.docker.com/engine/api/">Docker Engine API</a>, with support for TypeScript</p> <br /> <div style="display:flex;flex-direc

Downloads

8

Readme

Note See the contributing section for details on generating a different version of the client.

Getting Started

Start by installing the client using your preferred package manager, below is an example of Yarn.

yarn add @locktech/docker-client

The client is configured to use Axios for making requests, providing support for connecting to a UNIX socket. This functionality can be used to connect directly to the host machine's Docker dameon. Because requests are being made against the socket and not an HTTP server, the baseURL can be any valid URL.

import { Api } from '@locktech/docker-client'

export const docker = new Api({
  baseURL: 'http://localhost',
  socketPath: '/var/run/docker.sock',
})

Once the API has been initalized, it can be used to make requests against the configured Docker Engine API.

const DoSomething = async () => {
  const containers = await docker.containers.containerList({ ... })

  for (const container of containers.data) {
    ...
  }
}

Contributing

This repository acts as a template for generating, building, and publishing a client for the Docker Engine API. This process is triggered when a new release is created, which will use the configured specification as a reference for generation. After being generated, the built package is published to the npm registry.

name: CI — Generate and Release

env:
  # Update the following to change the reference used for generating the client.
  DOCKER_ENGINE_API: https://docs.docker.com/engine/api/v1.41.yaml

...

Building Manually

The following steps will build the client locally, and is the same set of steps used by the repository's CI runner.

  1. git clone https://github.com/LockTech/docker-client-ts.git
  2. npm install
  3. npm run generate https://docs.docker.com/engine/api/vX.XX.yaml
    • Generate a client using the given specification as a reference.
    • You can get the published version via the release workflow.
  4. npm run build

License

This repository and the generated code is provided under the MIT license. The reference Swagger specification - used to generate the client - is licensed under Apache 2.0.

References