package-lock-parsing
Parse and extract package information from npm package-lock.json files to identify dependencies and their installed versions.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- package-lock-parsing
- description
- Parse and extract package information from npm package-lock.json files to identify dependencies and their installed versions.
03 SKILL.md 正文
Package-lock.json Parsing
Overview
The package-lock.json file is an npm lock file that records exact dependency versions used in a project. It enables reproducible installs and is essential for vulnerability scanning.
File Structure
The package-lock.json follows this structure:
{
"name": "project-name",
"version": "1.0.0",
"lockfileVersion": 3,
"packages": {
"": {
"name": "project-name",
"version": "1.0.0",
"dependencies": {
"express": "^4.18.0"
}
},
"node_modules/express": {
"version": "4.18.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz"
}
}
}
Key Properties
- packages: Contains all packages (root + node_modules)
- version: The installed version of each package
- dependencies: Direct dependencies of a package
Extraction Pattern
import json
def parse_package_lock(file_path):
with open(file_path, 'r') as f:
lock_data = json.load(f)
packages = {}
for pkg_path, pkg_info in lock_data.get('packages', {}).items():
# Skip root package
if pkg_path == '':
continue
pkg_name = pkg_path.split('/')[-1]
version = pkg_info.get('version')
packages[pkg_name] = version
return packages
Usage
Use this skill when:
- Extracting dependency lists from package-lock.json
- Building vulnerability scanning pipelines
- Analyzing dependency versions for compliance
- Creating inventory reports of installed packages
Related Skills
trivy-vulnerability-scanning: Use parsed packages as input to vulnerability scannersecurity-audit-csv-reporting: Output results in structured CSV format
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.