Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sort-package-json

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sort-package-json - npm Package Compare versions

Comparing version 2.10.1 to 2.10.2

4

cli.js
#!/usr/bin/env node
import { globbySync } from 'globby'
import { globSync } from 'tinyglobby'
import fs from 'node:fs'

@@ -47,3 +47,3 @@ import getStdin from 'get-stdin'

function sortPackageJsonFiles(patterns, options) {
const files = globbySync(patterns)
const files = globSync(patterns)
const reporter = new Reporter(files, options)

@@ -50,0 +50,0 @@ const { isCheck } = options

@@ -80,3 +80,3 @@ import sortObjectKeys from 'sort-object-keys'

if (aName !== bName) {
return aName.localeCompare(bName)
return aName.localeCompare(bName, 'en')
}

@@ -83,0 +83,0 @@ if (!aRange) {

{
"name": "sort-package-json",
"version": "2.10.1",
"version": "2.10.2",
"description": "Sort an Object or package.json based on the well-known package.json keys",

@@ -74,6 +74,6 @@ "keywords": [

"git-hooks-list": "^3.0.0",
"globby": "^13.1.2",
"is-plain-obj": "^4.1.0",
"semver": "^7.6.0",
"sort-object-keys": "^1.1.3"
"sort-object-keys": "^1.1.3",
"tinyglobby": "^0.2.9"
},

@@ -80,0 +80,0 @@ "devDependencies": {

@@ -100,2 +100,8 @@ # Sort Package.json

This can, for instance, be used to generate a diff before changing `package.json`.
```bash
$ ( PKG="./package.json" ; cat "${PKG?}" | sort-package-json --stdin | diff "${PKG?}" - ; )
```
## API

@@ -102,0 +108,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc