This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Do this | |
const { writable, readable } = new TransformStream(); | |
const writer = writable.getWriter(); | |
writer.write('something'); | |
writer.write('something'); | |
writer.write('something'); | |
// Here, you can use the writer's `.ready` promise to determine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { | |
createHistogram, | |
performance: { | |
timerify | |
} | |
} = require('perf_hooks'); | |
const users = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Histogram { | |
min: 200, | |
max: 842751, | |
mean: 326.24267848, | |
exceeds: 0, | |
stddev: 512.5949230856029, | |
percentiles: SafeMap(30) [Map] { | |
0 => 200, | |
50 => 301, | |
75 => 401, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as foo from 'http://localhost:3001/foo.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There once was a repo written in C | |
The name of the repo was libshanty | |
The buffers overran, her memory leaked | |
O blow, my registers, blow. | |
Soon may the User folk come | |
And try our repo to build and run | |
One day, when the compilin's done | |
We'll make a release and go | |
She had not been two weeks released | |
When down on the net came a CVE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EventEmitter = require('events') | |
const { promisify } = require('util') | |
const foo = new EventEmitter() | |
const sleep = promisify(setTimeout) | |
foo.on('something', async () => { | |
await sleep(100) | |
try { | |
functionThatDoesNotExist() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters