{"id":10716,"library":"data-point","title":"DataPoint","description":"DataPoint is a JavaScript utility library designed for collecting, processing, and transforming data, offering a structured approach to manage complex data flows. It allows developers to define data transformations using a combination of 'reducers' for primitive operations, 'entities' for more complex, composite transformations, and 'middleware' for meta-tasks such as caching or logging. The current stable version is 3.5.0, but the package has not seen active development since its last significant update and publish in late 2018 / early 2019. This indicates a stalled or abandoned release cadence. Its key differentiators include a declarative way to compose data transformations and its explicit support for integration patterns through middleware. However, its age means it predominantly relies on CommonJS modules and was built for Node.js v8+, potentially posing compatibility challenges with modern JavaScript ecosystems and newer Node.js versions.","status":"abandoned","version":"3.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/ViacomInc/data-point","tags":["javascript","reduce","transform","process","functional","compose","aggregate"],"install":[{"cmd":"npm install data-point","lang":"bash","label":"npm"},{"cmd":"yarn add data-point","lang":"bash","label":"yarn"},{"cmd":"pnpm add data-point","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Requires Node.js v8 LTS or higher for runtime, as stated in documentation.","package":"node","optional":false}],"imports":[{"note":"This library is primarily CommonJS; direct ESM import syntax without a CommonJS interop layer will fail. Use `require`.","wrong":"import DataPoint from 'data-point'","symbol":"DataPoint","correct":"const DataPoint = require('data-point')"},{"note":"The `create` method is accessed via the default `DataPoint` object, not as a named export from the module directly.","wrong":"import { create } from 'data-point'","symbol":"create","correct":"const dataPoint = DataPoint.create()"},{"note":"The `resolve` method is an instance method of a created DataPoint object.","symbol":"resolve","correct":"dataPoint.resolve(reducer, input)"}],"quickstart":{"code":"const DataPoint = require('data-point')\n\n// create DataPoint instance\nconst dataPoint = DataPoint.create()\n\n// function reducer that concatenates\n// accumulator.value with 'World'\nconst reducer = (input) => {\n  return input + ' World'\n}\n\n// applies reducer to input\ndataPoint\n  .resolve(reducer, 'Hello')\n  .then((output) => {\n    // 'Hello World'\n    console.log(output)\n  })\n  .catch((error) => {\n    console.error('Error:', error)\n  })","lang":"javascript","description":"Demonstrates how to create a DataPoint instance, define a simple function reducer, and resolve an input string using the reducer."},"warnings":[{"fix":"Review the v3 changelog and migration guides carefully if upgrading from v2. Adjust reducer logic and factory calls to adhere to v3 expectations.","message":"The transition from v2 to v3 introduced breaking changes, such as the `ReducerList` factory now throwing an error for falsy input, and other adjustments to internal APIs and reducer behavior.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Exercise caution when adopting this library for new projects. Consider the risks of using unmaintained software, including potential security vulnerabilities and lack of future compatibility.","message":"The `data-point` library appears to be effectively unmaintained. The last significant updates and npm publish events occurred in late 2018 and early 2019, despite the latest version being 3.5.0. This means it may not be compatible with newer Node.js versions or modern JavaScript language features, and will not receive security patches or bug fixes.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Always use `require()` syntax for importing `data-point` in Node.js environments. If integrating into an ESM project, ensure Node.js is configured for CJS interop, or use dynamic `import()` if necessary.","message":"This library is predominantly written in CommonJS (CJS) module format. While Node.js supports CJS, attempting to import it directly using ES Module (ESM) syntax (`import ... from 'data-point'`) in an ESM-only environment can lead to errors without proper Node.js CJS-ESM interop configuration.","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":"Ensure the file using `require()` is treated as a CommonJS module (e.g., `.js` extension without `\"type\": \"module\"` in `package.json`). If ESM is required, use dynamic import `const DataPoint = await import('data-point')` but be aware of potential interoperability issues with older CJS modules.","cause":"Attempting to use `require()` in an ES Module (ESM) file (e.g., a file with `\"type\": \"module\"` in `package.json` or a `.mjs` extension).","error":"ReferenceError: require is not defined"},{"fix":"Revert to CommonJS `const DataPoint = require('data-point')` to ensure the module's exports are correctly assigned. In ESM, if dynamic import is used, access properties carefully, e.g., `(await import('data-point')).default.create()` if a default export is expected, but `require` is recommended for this library.","cause":"This error can occur if `data-point` is imported incorrectly in an ESM context, where `import DataPoint from 'data-point'` might not correctly resolve the default export of a CommonJS module, or if `DataPoint` is not the expected object.","error":"TypeError: DataPoint.create is not a function"}],"ecosystem":"npm"}