-
Call to Action: Accelerating Node.js Growth
Invitation to the Package Maintenance Working Group
https://medium.com/@nodejs/call-to-action-accelerating-node-js-growth-e4862bee2919
-
Small world with high risks
A study of security threats in the npm ecosystem
This file contains hidden or 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
#!/bin/bash | |
# Ensure not root | |
{ | |
if [ "$EUID" -e 0 ] | |
then echo "Please do not run this script as root" | |
exit | |
fi | |
} |
This file contains hidden or 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
# one or the other, NOT both | |
[url "https://github"] | |
insteadOf = git://github | |
# or | |
[url "[email protected]:"] | |
insteadOf = git://github |
This file contains hidden or 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
// Calculating and printing the SHA-1 hash of strings | |
const crypto = require('crypto') | |
const zlib = require('zlib') | |
function hashIt(string) { | |
return crypto | |
.createHash('sha1') | |
.update(string, 'utf-8') | |
.digest('hex') |
This file contains hidden or 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 fs = require('fs') | |
const path = require('path') | |
const directories = ['objects', 'refs'] | |
const command = process.argv[2] | |
switch (command) { | |
case 'init': | |
const repoPath = process.argv[3] || '' | |
const gitPath = path.resolve(repoPath, '.git') |
The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.
ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.
- .eslint.json
{
OlderNewer