Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mongodb-js-fmt
Advanced tools
Automatically rewrites our code to a shared spec because style is for tailors.
If you're seeing this message, it's because your module is still using mongodb-js-fmt
which has been sunset. This project has been hanging around for far too long... jsfmt
has long been replaced by prettier
and editor's are now completely different. It no longer is, it was. :)
mongodb-js-fmt
never even made it to a minor release, but it snuck into lots of project templates so I'm including this message to help cleanup.
Here's how to make this go away:
"fmt": "mongodb-js-fmt"
from "scripts"
in your package.jsonnpm uninstall --save-dev mongodb-js-fmt
"mongodb-js-fmt": "0.0.3"
in a friend's package.json
, send them a PR or this link https://github.com/mongodb-js/fmtThis project has been hanging around for far too long... jsfmt
has long been replaced by prettier
and editor's are now completely different.
Install prettier for the IDE/Editor of your choice.
The README below is preserved for future travelers.
Automatically rewrites our code to a shared spec because style is for tailors.
npm install --save-dev mongodb-js-fmt
Add a new fmt
script to your package.json
:
{
"name": "<your-module-name>",
"scripts": {
"fmt": "mongodb-js-fmt ./*.js lib/{**/*.js,*.js}"
}
}
Now run it to have your files rewritten:
npm run fmt
mongodb-js-fmt
is merely a thin wrapper around a code
rewriter and canonical configuration file that defines the
rules the rewriter should apply so all of our
code looks the same and we never have to
waste time on style in code reviews or arguing about
which rewriter tool is best.
Currently, we use jsfmt
from the Rdio team
as the rewriter. It's been an essential part of our daily
workflow since mid-2014 and literally saves us each hours
of work per month.
@todo: why does this module exist? package everything up in one box, strict control of upstreams, swap out the rewriter seamlessly when something better comes along e.g. want to ditch jsfmt for
eslint --autofix
+ fb's amazing http://npm.im/jscodeshift
--dry Display diffs instead of rewriting files [Default: `false`].
--changed Populate `<file>...` based on local changes via `git status` [Default: `false`].
--changed
Use git ls-files
to populate opts.files
--dry
Display diffs only and don't overwrite files.
Just need to publish to apm? Just want one source of truth and to be able
to delete the 100's of duplicate .jsfmtrc
files across our projects.
It's really nice, but needs a little time to tweak configs a bit to aggree w/ eslint rules. This allows for:
var res = {formatted: [], unchanged: []};
instead of always forcing:
var res = {
formatted: [],
unchanged: []
};
Apache 2
FAQs
Automatically rewrites our code to a shared spec because style is for tailors.
We found that mongodb-js-fmt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 36 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.