Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Bring your JavaScript into the future.
$ npm install -g esnext
After installing, run esnext -h
for comprehensive usage instructions.
Translate some regular functions to arrow functions:
list.map(function(item) { return item.name; });
// ↑ becomes ↓
list.map(item => item.name);
Convert var
declarations to let
or const
as appropriate:
var arr = [];
for (var i = 0; i < 5; i++) {
arr.push(i);
}
// ↑ becomes ↓
const arr = [];
for (let i = 0; i < 5; i++) {
arr.push(i);
}
Use shorthand syntax for various object constructs:
let person = {
first: first,
last: last,
fullName: function() {
return `${first} ${last}`;
}
};
// ↑ becomes ↓
let person = {
first,
last,
fullName() {
return `${first} ${last}`;
}
};
Convert string concatenation to string or template literals:
let name = 'Brian' + ' ' + 'Donovan';
let greeting = 'Hello, ' + name;
// ↑ becomes ↓
let name = 'Brian Donovan';
let greeting = `Hello, ${name}`;
Convert assignments and declarations to use object destructuring syntax:
let a = obj.a, b = obj.b;
a = obj2.a, b = obj2.b;
// ↑ becomes ↓
let { a, b } = obj;
({ a, b } = obj2);
Translate CommonJS modules into ES6 modules:
var readFile = require('fs').readFile;
const MagicString = require('magic-string');
let { ok, strictEqual: eq } = require('assert');
exports.doSomething = function() {
ok(1);
};
// ↑ becomes ↓
import { readFile } from 'fs';
import MagicString from 'magic-string';
import { ok, strictEqual as eq } from 'assert';
export function doSomething() {
ok(1);
}
{
'declarations.block-scope': {
/**
* Set this to `true` to only turn `var` into `let`, never `const`.
*/
disableConst: boolean
}
}
FAQs
Update your project to the latest ECMAScript syntax.
The npm package esnext receives a total of 9,991 weekly downloads. As such, esnext popularity was classified as popular.
We found that esnext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.