# cgroups

> cgroups for node

Latest version **1.0.0** (published 2015-05-25) · BSD license · 0 weekly downloads

## Install

```sh
npm install cgroups
pnpm add cgroups
yarn add cgroups
bun add cgroups
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-05-25 |
| First published | 2015-05-25 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Asbjorn Enge |
| Maintainers | asbjornenge |
| Keywords | cgroups, linux |

## Links

- npm: https://www.npmjs.com/package/cgroups
- Repository: https://github.com/asbjornenge/cgroups
- Homepage: https://github.com/asbjornenge/cgroups#readme
- Issues: https://github.com/asbjornenge/cgroups/issues
- npm.io page: https://npm.io/package/cgroups

## Dependencies (1)

- [async](https://npm.io/package/async.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2015-05-25

## README

# cgroups

This module is an experiment in exposing the [cgroups](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt) "API" to node. Who knows what will happen...

## Use

```js
var cgroups = require('cgroups')

// Make a cgroup
cgroups.create('yolo', {cpuset:{cpus:'0'}}, function(err) {
    var child = chpr.spawn('bash')
    cgroups.movePid(child.pid, 'cpuset/yolo', function(err) {
        // the child is now in the cpuset/yolo cgroup limited to cpu 0
    })
})
```

## API

```
create(name, resourceTree, callback)  // Make a cgroup
movePid(pid, path/to/group, callback) // Add pid to cgroup
remove(name, resourceTree, callback)  // Remove a cgroup
set(name, resourceTree, callback)     // Set values in cgroup
getGroups(pid, callback)              // Get cgroups for pid
```

enjoy.

---
_Source: https://npm.io/package/cgroups · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
