{"id":12903,"library":"bplist","title":"Binary Property List Parser and Creator","description":"The `bplist` package, currently at version `0.0.4`, provides functionality for parsing and creating binary property lists (bplists). It serves as a convenience wrapper around two other modules: `bplist-parser` for reading bplist data and `bplist-creator` for generating it. This package was last published in 2012, and its dependencies, `bplist-parser` (last updated 2016) and `bplist-creator` (last updated 2013), are also largely unmaintained. Due to its age and lack of updates, it operates exclusively with CommonJS (`require`) syntax and does not offer native ESM support or TypeScript type definitions. Given its long period without maintenance, it is not recommended for new projects, especially those with security considerations or requiring modern JavaScript features.","status":"abandoned","version":"0.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/ladinu/bplist","tags":["javascript","bplist","bplist parser","binary plist","plist","binary plist parser"],"install":[{"cmd":"npm install bplist","lang":"bash","label":"npm"},{"cmd":"yarn add bplist","lang":"bash","label":"yarn"},{"cmd":"pnpm add bplist","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides core binary plist parsing functionality.","package":"bplist-parser","optional":false},{"reason":"Provides core binary plist creation functionality.","package":"bplist-creator","optional":false}],"imports":[{"note":"This package is CommonJS-only due to its age (2012). ESM `import` will not work directly.","wrong":"import bplist from 'bplist';","symbol":"bplist","correct":"const bplist = require('bplist');"},{"note":"The module exports a single object containing `create` and `parseBuffer`. Destructuring is not supported.","wrong":"const { create } = require('bplist');","symbol":"create","correct":"const bplist = require('bplist');\nbplist.create(...);"},{"note":"The module exports a single object containing `create` and `parseBuffer`. Named ESM imports or CJS destructuring are not supported.","wrong":"import { parseBuffer } from 'bplist';","symbol":"parseBuffer","correct":"const bplist = require('bplist');\nbplist.parseBuffer(...);"}],"quickstart":{"code":"const bplist = require('bplist');\nconst fs = require('fs'); // For saving/loading example, not a direct dependency of bplist\n\n// 1. Create a binary plist from a JavaScript object\nconst originalData = {\n  applicationName: 'My Awesome App',\n  version: '1.0.0',\n  features: ['notifications', 'offline-mode'],\n  settings: {\n    darkMode: true,\n    fontSize: 14\n  },\n  timestamp: new Date()\n};\n\nconsole.log('Original JavaScript Object:', originalData);\n\nlet binaryPlistBuffer;\ntry {\n  // bplist.create returns a Buffer\n  binaryPlistBuffer = bplist.create(originalData);\n  console.log('Created Binary Plist Buffer (first 20 bytes):', binaryPlistBuffer.toString('hex', 0, 20), '...');\n\n  // Optionally, save to a file for inspection\n  // fs.writeFileSync('example.bplist', binaryPlistBuffer);\n  // console.log('Saved to example.bplist');\n\n} catch (error) {\n  console.error('Error creating bplist:', error);\n  process.exit(1);\n}\n\n// 2. Parse a binary plist buffer back into a JavaScript object\nif (binaryPlistBuffer) {\n  bplist.parseBuffer(binaryPlistBuffer, (err, result) => {\n    if (err) {\n      console.error('Error parsing bplist buffer:', err);\n      return;\n    }\n    // bplist.parseBuffer returns an array of objects\n    console.log('Parsed JavaScript Object:', result[0]);\n    console.log('Verification: Does originalData match parsed result?',\n                JSON.stringify(originalData) === JSON.stringify(result[0]));\n  });\n}","lang":"javascript","description":"Demonstrates how to use `bplist` to both create a binary plist buffer from a JavaScript object and parse a binary plist buffer back into an object, highlighting its CommonJS usage."},"warnings":[{"fix":"Consider using actively maintained alternatives for binary plist parsing/creation, or fork and maintain the package yourself with caution.","message":"This package has been abandoned since 2012 and receives no updates, posing significant security risks and incompatibility issues with modern Node.js or browser environments.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"For ESM projects, use dynamic `import()` or configure your bundler (e.g., Webpack, Rollup) to handle CJS interop, or set `\"type\": \"commonjs\"` in your `package.json` for Node.js environments.","message":"The package is exclusively CommonJS (`require`) and does not offer native ESM support. Using it in a pure ESM project will require a CommonJS wrapper or specific bundler configuration.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Create a `declarations.d.ts` file in your project with `declare module 'bplist';` or more specific type definitions if you intend to use it extensively with TypeScript.","message":"There are no TypeScript type definitions available for this package. This means you will either need to write your own declaration files or use it with `any` types, reducing type safety.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Thoroughly audit the source code of both `bplist-parser` and `bplist-creator` if using this package in a sensitive environment, or seek modern alternatives.","message":"The core functionalities are provided by `bplist-parser` (last updated 2016) and `bplist-creator` (last updated 2013), both of which are also unmaintained and may contain their own vulnerabilities or outdated implementations.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Avoid using this package for new, mission-critical applications where API stability and long-term support are required.","message":"As a `0.0.4` release from 2012, the API stability was likely never fully guaranteed. It should be treated as experimental or proof-of-concept code rather than production-ready.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Change your project's `package.json` to `\"type\": \"commonjs\"` or use a dynamic import: `import('bplist').then(bplist => bplist.create(...))`.","cause":"Attempting to use `require('bplist')` in a Node.js project where `package.json` specifies `\"type\": \"module\"` (ESM context).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported. Instead change the require of ... to a dynamic import()"},{"fix":"Ensure you import the entire module object using `const bplist = require('bplist');` and then access methods like `bplist.create(...)`.","cause":"Incorrectly destructuring the CommonJS module import, or attempting to use `create` directly after an improper import.","error":"TypeError: bplist.create is not a function"},{"fix":"Create a declaration file (e.g., `src/types/bplist.d.ts`) with `declare module 'bplist';` or more specific type definitions if known, to avoid implicit any errors.","cause":"Using `bplist` in a TypeScript project without available type definitions.","error":"Could not find a declaration file for module 'bplist'. '.../node_modules/bplist/index.js' implicitly has an 'any' type."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}