Install nodejs 20 on ubuntu
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs
9 февраля 2024, 12:52
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs
const http = require('http'); http.request(url, { method: 'HEAD' }, (res) => { console.log(res.statusCode); }) .on('error', (err) => { console.error(err); }) .end();
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs
npm rebuild node-sass
export NODE_OPTIONS=--max_old_space_size=4096
knex( knex('A').where('A.id',1).as('t1') ).leftJoin( knex('B').where('B.id', 2).as('t2'), 't1.c', 't2.d' )
docker run \ -e "NODE_ENV=production" \ -u "node" \ -m "300M" --memory-swap "1G" \ -w "/home/node/app" \ --name "my-nodejs-app" \ node [script]
const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }); array.sort(collator.compare);
const v8 = require('v8'); const structuredClone = obj => { return v8.deserialize(v8.serialize(obj)); };
# Using Ubuntu curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - sudo apt-get install -y nodejs