# @collaborne/use-cgroup-memory-limits

> Wrapper to apply cgroup memory limits to a Node process

Latest version **0.3.0** (published 2020-11-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @collaborne/use-cgroup-memory-limits
pnpm add @collaborne/use-cgroup-memory-limits
yarn add @collaborne/use-cgroup-memory-limits
bun add @collaborne/use-cgroup-memory-limits
```

Provides the command `use-cgroup-memory-limits`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-11-23 |
| First published | 2020-11-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 87.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Andreas Kohn |
| Maintainers | ronnyroeller, ankon, collaborne-team |
| Keywords | cgroups, nodejs, wrapper, docker, container, memory, limit, quotas |

## Links

- npm: https://www.npmjs.com/package/@collaborne/use-cgroup-memory-limits
- Repository: https://github.com/Collaborne/node-use-cgroup-memory-limits
- Homepage: https://github.com/Collaborne/node-use-cgroup-memory-limits#readme
- Issues: https://github.com/Collaborne/node-use-cgroup-memory-limits/issues
- npm.io page: https://npm.io/package/@collaborne/use-cgroup-memory-limits

## Dependencies (1)

- [@stroncium/procfs](https://npm.io/package/@stroncium/procfs.md) ^1.2.1

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2020-11-23
- 0.2.1 — 2020-11-23
- 0.2.0 — 2020-11-23
- 0.1.5 — 2020-11-14
- 0.1.4 — 2020-11-04
- 0.1.3 — 2020-11-04
- 0.1.2 — 2020-11-04
- 0.1.1 — 2020-11-04
- 0.1.0 — 2020-11-04

## README

# @collaborne/use-cgroup-memory-limits [![Build Status](https://travis-ci.com/Collaborne/node-use-cgroup-memory-limits.svg?branch=main)](https://travis-ci.com/Collaborne/node-use-cgroup-memory-limits)

A small wrapper around NodeJS that looks at the Cgroups memory settings, and sets the `--max-old-space-size` command-line argument in `NODE_OPTIONS` when it is not yet set.

## Usage

1. Install as a runtime dependency

   ```sh
   npm install @collaborne/use-group-memory-limits
   ```

2. Use `use-cgroup-memory-limits` instead of `node` in your start scripts

   ```jsonc
   {
       "name": "my-package",
       // ...
       "scripts": {
           "start": "use-cgroup-memory-limits my-package-index.js"
       },
       // ...
   }
   ```

## License


```LICENSE
This software is licensed under the Apache 2 license, quoted below.

Copyright 2020 Collaborne B.V. <http://github.com/Collaborne/>

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
```

---
_Source: https://npm.io/package/@collaborne/use-cgroup-memory-limits · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
