How to limit cpu usage with Nodejs?

I want to introduce the node-cpulimit in this post.When i use puppeteer ,some page cost a long time in page loading. At the same time , the cpu limit will increase instantly.So i want to find some tools to help limit the cpu usage.

A very simple example to use cpulimit and childprocess

const limiter = require('cpulimit');

// Run command
const { spawn } = require('child_process');
const node = spawn('node', ['/root/puppeteer.js']);

// Run cpulimit
const options = {
  limit: 50, // or any other value
  includeChildren: true,

limiter.createProcessFamily(options, (err, processFamily) => {
  if (err) {
    console.error('Error:', err.message);

  limiter.limit(processFamily, options, (err) => {
    if (err) {
      console.error('Error:', err.message);
    } else {

for more detail pls visit