Socket
Socket
Sign inDemoInstall

container-info

Package Overview
Dependencies
0
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    container-info

Parse container info from cgroups file


Version published
Weekly downloads
74K
decreased by-0.27%
Maintainers
3
Install size
5.49 kB
Created
Weekly downloads
 

Readme

Source

container-info

Parse container info from cgroups file.

Install

npm install container-info

Usage

const getContainerInfo = require('container-info')

// Sync
const { containerId, podId } = getContainerInfo.sync()
console.log({ containerId, podId })

// Async
getContainerInfo().then(({ containerId, podId }) => {
  console.log({ containerId, podId })
})

// Parse cgroup file contents
const { containerId, podId } = getContainerInfo.parse(`
  1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope
`)

Keywords

FAQs

Last updated on 15 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc