Build static websites
The world’s fastest framework for building websites
Delete all node_modules recursively down from where it is run (this command assumes the trash executable exists on the system… brew install trash)
find . -name node_modules -type d -prune -exec trash {} +I have this aliased in zsh to killnm.
Fix transitive dependency vulnerability
package.json version notation
Update npm package with yarn
How to upgrade a yarn package to the latest version
Destructuring
Say we have an employee object
const employee = {
id: 007,
name: 'James',
dept: 'Spy'
}And we wanted to retrieve a property that may or may not be assigned yet, we could do it like this:
const age = employee.age ? employee.age : 25;Conditionally assigning to age, the age from the employee or a default value.
Alternatively, we can destructure with a default value like this:
const { name, age = 25 } = employee;
console.log(age);