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 net from 'net'; | |
import * as rl from 'readline'; | |
import assert from 'assert/strict'; | |
const [ COMMAND, PORT, HOST ] = process.argv.splice(2); | |
try { | |
assert.strictEqual( | |
['open', 'host'].includes(COMMAND), | |
true, |
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
Please write a data structure which has the following method: | |
1. setValue (index, value) - set the structure at `index` to `value` | |
2. getValue (index) - get the value of the data structure at `index` | |
3. setAll (value) - set all indices in the data structure to `value` | |
please implement all method in O(1) runtime. | |
Expected behaviour: |
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
# | |
# NPM | |
# | |
# List globally installed dependencies without full tree | |
npm list -g --depth=0 | |
# Install package under an alias (cli / package) | |
npm i foo@npm:bar | |
"foo": "npm:bar@^1.2.3" |