0.1.4 • Published 1 year ago

memory-per-cpu v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Memory per cpu

A nice helper to calculate the maximum number of workers given the system memory with a minimum of 1 and a maximum of the cpu count

This is very handy for testing with for example jest. Where modern computers have a high number of cpu's compared to memory and the CICD has a 1 core per 2 or 4 gigs of memory

Jest example

// jest.config.js

const memoryPerCpu = require('memory-per-cpu');
/** @type {import('jest').Config} */
module.exports = {
  maxWorkers: memoryPerCpu(3),
};
0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago