Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
js-sort-object-properties
Advanced tools
It's a small npm module for sorting object properties in javascript code.
/Status:/ Very alpha
** Installation :PROPERTIES: :ID: 718304C8-8F74-4503-AB94-702CCB0192AC :END:
I haven't published it to npm yet (it's in early alpha atm), so you gotta clone the repository and do an npm install or npm link
** Usage
Installing/linking this package will expose a single command named jsop. jsop accepts no arguments. It takes input from stdin and provides output to stdout. If your code is correct, you'll get same code as output with all the objects' properties sorted. Else it'll fail in your face, so keep an eye for a quick jab.
#+BEGIN_SRC bash echo "var o = {c: 'c', a: 'a', b: 'b'}" | jsop #+END_SRC
#+results: var o = { a: 'a', b: 'b', c: 'c' };
#+BEGIN_SRC bash cat myJsFile.js | jsop > myJsFile.js #+END_SRC
*** Warning
Currently if you pass it an object (e.g {a: 'a'}), it fails. That one is on esprima. I'll fix it in the future. Just watch out for now.
Make sure you pass it the object with the indentifier you bind it to. e.g var o = {a: 'a'};
** Editor plugins
My real intention to create this package is to use it from within my text-editor. I wanted to just select an object, and sort its properties with a key combination. ./editor-plugins directory has plugins for following editors:
*** Emacs
Emacs is the only supported editor as of now (because it's the only editor I use these days).
**** Install
Just put the ./editor-plugins/emacs/jsop.el somewhere on your load-path and you're good to go.
**** Usage
M-x
and select jsop
FAQs
Sort properties in a javascript object
The npm package js-sort-object-properties receives a total of 0 weekly downloads. As such, js-sort-object-properties popularity was classified as not popular.
We found that js-sort-object-properties 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.