{"id":13015,"library":"crx-parser","title":"CRX File Parser","description":"crx-parser is a utility library for Node.js designed to parse Chrome Extension (CRX) files. It extracts metadata and content from CRX packages, which are essentially ZIP archives with a special header. The package is currently at version 0.1.2 and was last published approximately nine years ago, indicating it is no longer actively maintained. Its primary use case is for programmatic inspection or processing of older CRX files, likely those conforming to CRX format versions 2 or 3. Due to its age, it does not support modern CRX format versions (e.g., CRX3) or modern JavaScript module systems like ESM out-of-the-box, relying solely on CommonJS.","status":"abandoned","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/shyiko/node-crx-parser","tags":["javascript","crx","parser"],"install":[{"cmd":"npm install crx-parser","lang":"bash","label":"npm"},{"cmd":"yarn add crx-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add crx-parser","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and relies on Node.js built-in modules like 'fs'.","symbol":"parseCRX","correct":"const parseCRX = require('crx-parser');"},{"note":"While CJS interop *might* allow `import parseCRX from 'crx-parser';` in an ESM context, it's not officially supported. The package does not export named members for ESM.","wrong":"import { parseCRX } from 'crx-parser';","symbol":"parseCRX","correct":"import parseCRX from 'crx-parser';"}],"quickstart":{"code":"const fs = require('fs');\nconst parseCRX = require('crx-parser');\n\n// Imagine you have a CRX file downloaded, e.g., to a temporary path.\n// For a real scenario, replace '/tmp/example.crx' with your actual file path.\n// You might need to create a dummy CRX file for local testing or download one.\n// Note: This package likely only supports older CRX formats (v2/v3).\n\nconst crxFilePath = '/tmp/mfabfdnimhipcapcioneheloaehhoggk.crx';\n\nfs.readFile(crxFilePath, function (err, buff) {\n    if (err) {\n        console.error('Error reading CRX file:', err.message);\n        if (err.code === 'ENOENT') {\n            console.error('Please ensure the CRX file exists at ' + crxFilePath);\n        }\n        return;\n    }\n\n    parseCRX(buff, function (err, data) {\n        if (err) {\n            console.error('Error parsing CRX file:', err.message);\n            return;\n        }\n        console.log('CRX Header Public Key:', data.header.publicKey.toString('hex'));\n        console.log('CRX Header Version:', data.header.version);\n        console.log('CRX Extension ID:', data.id);\n        // Data also contains 'buffer' (the unzipped extension content)\n        // and 'files' (array of { name, content } for each file).\n        console.log(`CRX contains ${data.files.length} files.`);\n    });\n});","lang":"javascript","description":"This quickstart demonstrates how to read a CRX file from disk and parse its contents, logging the public key and other header information using the CommonJS `require` syntax."},"warnings":[{"fix":"Consider alternative, actively maintained CRX parsing libraries if available, or implement custom parsing logic for newer CRX formats. For historical CRX versions, evaluate risks.","message":"This package is severely outdated and has been abandoned for approximately nine years. It has not received updates for new CRX format versions (e.g., CRX3), bug fixes, or security patches. Using it with modern CRX files will likely result in parsing errors.","severity":"breaking","affected_versions":"<=0.1.2"},{"fix":"Always use `const parseCRX = require('crx-parser');` when integrating this library into a Node.js project. If used in an ESM project, consider dynamic `import()` or a transpilation step that handles CJS modules.","message":"The package is CommonJS-only and does not natively support ES Modules (ESM). Direct `import` statements may fail or require specific bundler configurations for CJS interop, which is not guaranteed for such an old package.","severity":"gotcha","affected_versions":"<=0.1.2"},{"fix":"Avoid using this package for processing CRX files from untrusted sources in production environments. If absolutely necessary, run in an isolated and sandboxed environment.","message":"Lack of maintenance poses potential security risks. Unpatched vulnerabilities in the parsing logic or its dependencies could be exploited if processing untrusted CRX files.","severity":"gotcha","affected_versions":"<=0.1.2"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure your file is treated as a CommonJS module (e.g., `.js` file in a `type: \"commonjs\"` project, or no `type` field in `package.json`). If you must use ESM, consider `import('./crx-parser').then(mod => mod.default);` or a bundler to handle CJS interop.","cause":"Attempting to use `require()` in a JavaScript module that is treated as an ES Module (e.g., in a `type: \"module\"` package.json or a `.mjs` file).","error":"ReferenceError: require is not defined"},{"fix":"Verify that the input file is indeed an older CRX format (v2 or v3). This parser will not work for modern CRX files. Use a different tool or implement custom parsing for CRX3.","cause":"The input buffer is not a valid CRX file, or it's a newer CRX format (e.g., CRX3) that this parser does not recognize, which uses a different header structure.","error":"Error: CRX header magic number mismatch"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}