Skip to main content

extract_package_json_from_str

Function extract_package_json_from_str 

Source
pub fn extract_package_json_from_str(
    file: &str,
    content: &str,
    enabled_keywords: &[&'static str],
) -> Vec<ExtractedCommand>
Expand description

Extract executable scripts from package.json.

Extracts:

  • All values in scripts object (these are npm script commands)
  • Lifecycle scripts: preinstall, postinstall, prepublish, etc.

Does NOT extract:

  • description, keywords, repository fields
  • Values in config or other non-executable fields