
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
CLI to convert JavaScript files from CommonJS to ES6 / ES2015 modules format. The process isn't foolproof, but it can usually get you ~95% of the way there.
This tool uses jscodeshift to run 5to6-codemod, js-codemod and js-import-sort under the hood. It's an opinionated migration to a format suitable for use in ES2015+ programs & scripts.
For extra safety, please consider using standard to sanitize your code.
npm i -g cjs-to-es6
cjs-to-es6 [ --verbose ] files/directories...
All files are modified in-place. You may want to review & rename them to the .mjs extension, if using Node 14 or later. Un-converted files should use the .cjs extension.
Examples:
cjs-to-es6 index.js # convert a single file
cjs-to-es6 lib/ # convert all files in a directory & its subdirectories (.js & .cjs)
cjs-to-es6 foo.js bar.js lib/ # convert many files/directories
FAQs
Convert JavaScript files from CommonJS to ES6 modules
The npm package cjs-to-es6 receives a total of 1,064 weekly downloads. As such, cjs-to-es6 popularity was classified as popular.
We found that cjs-to-es6 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
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.