npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

js-sort-object-properties

v0.1.0

Published

Sort properties in a javascript object

Readme

  • js-sort-object-properties

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

  • Install the [[id:718304C8-8F74-4503-AB94-702CCB0192AC][npm package]]
  • Select a javascript object
  • M-x and select jsop