component-xor is a minuscule JavaScript utility package providing a single function, `xor(bool, bool)`, to compute the exclusive OR of two boolean values. Released under the MIT license, its latest version is 0.0.4, published in 2015. This package is part of the 'component' ecosystem, an early web package manager that predates modern module bundlers and is no longer actively maintained. Due to its age and the deprecation of its original ecosystem, it lacks modern features like ES Modules support and active development. Its key differentiator was its extreme simplicity and adherence to the 'component' philosophy, but it is now effectively abandoned. For new projects, developers should implement the simple XOR logic directly or use modern alternatives, as `component-xor` does not receive updates or support.
npm install component-xorVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of the `xor` function with various boolean and truthy/falsy inputs, illustrating its simple boolean logic.
Do not use `component-xor` in new projects. For existing projects, consider replacing it with a direct implementation of the XOR logic (`(a && !b) || (!a && b)`) or a modern, actively maintained utility library.
Ensure you use CommonJS `require()` syntax (`const xor = require('component-xor');`) to import this package. For ES Module projects, consider writing the XOR logic inline or finding an ESM-compatible alternative.For bitwise XOR, use the `^` operator (e.g., `a ^ b`). For logical XOR in modern JavaScript, consider `Boolean(a) !== Boolean(b)` or `(a && !b) || (!a && b)`.
Replace the import statement with the CommonJS `require()` syntax: `const xor = require('component-xor');`.Verify that `component-xor` is listed in your `package.json` and `node_modules`. Ensure you have a correct `const xor = require('component-xor');` statement at the top of your file.No dependency data recorded yet.