{"id":12786,"library":"absolute","title":"Absolute Path Checker","description":"The `absolute` package is a minimalist utility designed to test whether a given string represents an absolute file path. Published over a decade ago (version 0.0.1, last updated February 2015), it served a simple purpose in the early Node.js ecosystem. The package performs basic string checks to determine if a path starts with a root directory separator (e.g., `/` on Unix-like systems). It is not actively maintained and is considered abandoned. For modern Node.js applications, the built-in `path.isAbsolute()` method, which is part of the core `path` module, is the recommended and superior alternative. `path.isAbsolute()` provides robust, platform-aware checks for absolute paths, handling nuances like Windows drive letters and UNC paths, which this `absolute` package does not. Developers should migrate away from this package to avoid potential issues related to lack of maintenance and limited functionality.","status":"abandoned","version":"0.0.1","language":"javascript","source_language":"en","source_url":"git://github.com/bahamas10/node-absolute","tags":["javascript"],"install":[{"cmd":"npm install absolute","lang":"bash","label":"npm"},{"cmd":"yarn add absolute","lang":"bash","label":"yarn"},{"cmd":"pnpm add absolute","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and was published before widespread ES Module adoption. It exports a single function as its module.exports.","symbol":"absolute","correct":"const absolute = require('absolute');"}],"quickstart":{"code":"const absolute = require('absolute');\n\nconsole.log(absolute('/home/dave'));\n// => true\n\nconsole.log(absolute('/something'));\n// => true\n\nconsole.log(absolute('./myfile'));\n// => false\n\nconsole.log(absolute('temp'));\n// => false","lang":"javascript","description":"Demonstrates how to import and use the 'absolute' function to check various path strings."},"warnings":[{"fix":"Migrate to `require('path').isAbsolute()` or `import { isAbsolute } from 'path';` for modern applications.","message":"This package is abandoned and has not been updated in over a decade. It is superseded by the built-in `path.isAbsolute()` method in Node.js, which offers more robust and platform-aware functionality.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Use Node.js's native `path.isAbsolute()` which is designed to handle platform differences correctly.","message":"The `absolute` package performs simple string-based checks and does not inherently understand operating system-specific path semantics (e.g., Windows drive letters, UNC paths). This can lead to incorrect results on non-POSIX systems.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"If you must use this package (which is discouraged), ensure your environment supports CommonJS `require()` or use a build step that can transpile CJS to ESM. The recommended fix is to switch to `path.isAbsolute()`.","message":"The package is strictly CommonJS (CJS) and does not provide native ES Module (ESM) exports. Attempting to use `import absolute from 'absolute';` in an ESM context without proper transpilation may lead to errors.","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":"Use the CommonJS default import pattern: `const absolute = require('absolute');`","cause":"Attempting to use named import syntax (e.g., `import { absolute } from 'absolute';`) for a CommonJS package that exports a single function as its `module.exports`.","error":"TypeError: absolute is not a function"},{"fix":"If running in an ESM environment, you cannot directly use `require()`. You should either refactor your file to use ESM imports for other packages or, preferably, switch to Node.js's built-in `path.isAbsolute()` which supports both CJS and ESM.","cause":"Attempting to use `require()` within an ES Module (ESM) file, where `require` is not globally available.","error":"ReferenceError: require is not defined (in ES Module scope)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null}