{"id":14856,"library":"raptor-util","title":"RaptorJS Utilities","description":"This library, `raptor-util`, is a collection of core utility functions designed for the RaptorJS framework, an end-to-end JavaScript toolkit initially developed by eBay for building adaptive modules and UI components. The package provides various common helpers, likely including object manipulation, type checking, and other foundational utilities to support the broader RaptorJS ecosystem. The current version is 3.2.0. However, the RaptorJS framework and its associated packages, including `raptor-util`, appear to be abandoned, with the last notable activity around 2017 and related npm packages last published around 2014-2015. It is no longer actively maintained or developed, making it unsuitable for new projects.","status":"abandoned","version":"3.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/raptorjs/raptor-util","tags":["javascript"],"install":[{"cmd":"npm install raptor-util","lang":"bash","label":"npm"},{"cmd":"yarn add raptor-util","lang":"bash","label":"yarn"},{"cmd":"pnpm add raptor-util","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package primarily targets CommonJS environments. While ES Modules syntax might be attempted, it will likely fail or require bundler/transpiler configuration for compatibility.","wrong":"import { extend } from 'raptor-util';","symbol":"extend","correct":"const { extend } = require('raptor-util');"},{"note":"Named exports are the typical pattern for this library. Attempting to destructure directly from `require` is the idiomatic CommonJS approach.","wrong":"const isObject = require('raptor-util').isObject;","symbol":"isObject","correct":"const { isObject } = require('raptor-util');"},{"note":"There is no default export. Individual utility functions are exported as named members of the module.","wrong":"import forEach from 'raptor-util';","symbol":"forEach","correct":"const { forEach } = require('raptor-util');"}],"quickstart":{"code":"const { extend, isObject, forEach } = require('raptor-util');\n\n// Example: Extending an object\nconst obj1 = { a: 1, b: 2 };\nconst obj2 = { b: 3, c: 4 };\nconst merged = extend({}, obj1, obj2);\nconsole.log('Extended object:', merged); // Expected: { a: 1, b: 3, c: 4 }\n\n// Example: Checking if a variable is an object\nconsole.log('Is {}:', isObject({})); // Expected: true\nconsole.log('Is null:', isObject(null)); // Expected: false\n\n// Example: Iterating over an array or object\nconst items = ['apple', 'banana', 'cherry'];\nconsole.log('Iterating over items:');\nforEach(items, (item, index) => {\n  console.log(`  ${index}: ${item}`);\n});\n\nconst data = { name: 'Alice', age: 30 };\nconsole.log('Iterating over data:');\nforEach(data, (value, key) => {\n  console.log(`  ${key}: ${value}`);\n});","lang":"javascript","description":"This quickstart demonstrates importing `extend`, `isObject`, and `forEach` utilities using CommonJS `require` and showcases their basic usage for object merging, type checking, and iteration."},"warnings":[{"fix":"Avoid using `raptor-util` for new projects. Consider modern, actively maintained utility libraries like Lodash, Ramda, or even native browser/Node.js APIs which have evolved significantly since this package's last update.","message":"The `raptor-util` package and the broader RaptorJS framework are abandoned. The last activity on the GitHub repository was in 2017, and related npm packages were last published in 2014-2015. It is not maintained and may contain unpatched vulnerabilities or incompatibilities with modern JavaScript runtimes.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"If absolutely necessary to use in a modern project, configure your bundler (e.g., Webpack, Rollup, Parcel) to handle CommonJS modules or use a CommonJS compatible Node.js environment. For browser usage, ensure it's bundled and polyfilled appropriately.","message":"`raptor-util` was developed primarily for CommonJS environments (Node.js versions prevalent before 2017). Using it in modern ESM-only projects or environments without proper transpilation/bundling can lead to 'require is not defined' errors or other module resolution failures.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Create a `declarations.d.ts` file or similar in your project with `declare module 'raptor-util';` or more specific declarations for the functions you use. For example: `declare module 'raptor-util' { export function extend(...args: any[]): any; export function isObject(value: any): boolean; export function forEach(collection: any, iteratee: Function): void; }`","message":"This library does not ship with TypeScript type definitions. Using it in a TypeScript project will require manually creating declaration files (e.g., `raptor-util.d.ts`) to provide type safety and avoid compiler errors.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"This package is designed for CommonJS. You either need to run your code in a CommonJS environment or configure a bundler to handle CommonJS modules within an ESM project. Direct ESM `import` statements for `raptor-util` are unlikely to work without extensive build tooling.","cause":"Attempting to use `require()` in an ECMAScript Module (ESM) context (e.g., in a `.mjs` file or when `\"type\": \"module\"` is set in `package.json`).","error":"ReferenceError: require is not defined"},{"fix":"Double-check the exact export names of the utility functions you intend to use. Without official documentation, this may require inspecting the package's source code if you truly need to use it. Many common utility functions have standard names, but this package's specific exports are not publicly documented.","cause":"Attempting to import a function that does not exist or has a different name than expected from the `raptor-util` module.","error":"TypeError: Cannot destructure property 'someFunction' of require(...) as it is undefined."}],"ecosystem":"npm"}