pub fn parse_scripts_from_json(content: &str) -> Result<Scripts>Expand description
Parse scripts from package.json content.
§Arguments
content- The raw JSON content
§Errors
Returns an error if the JSON is malformed.
§Examples
use npm_run_scripts::package::scripts::parse_scripts_from_json;
let json = r#"{"scripts": {"dev": "vite", "build": "vite build"}}"#;
let scripts = parse_scripts_from_json(json).unwrap();
assert_eq!(scripts.len(), 2);