Skip to main content

sort_package_json

Function sort_package_json 

Source
pub fn sort_package_json(input: &str) -> Result<String, Error>
Expand description

Sorts a package.json string with the default options.

The output is pretty-printed with a trailing newline. Script order is preserved.

ยงErrors

Returns an error when input is not valid JSON.