@almsomnia/logic-gate
v1.0.0
Published
A library to work with logical gates.
Readme
Logic Gate JS
A simple package for simulating logic gates.
Features
- Support basic logic gates
- Lightweight and easy to user
- Support TypeScript
Installation
# npm
npm install @almsomnia/logic-gate
# pnpm
pnpm add @almsomnia/logic-gate
# yarn
yarn add @almsomnia/logic-gate
# bun
bun add @almsomnia/logic-gateUsage
Import and use the package in your project:
import { and, or, not, xor } from '@almsomnia/logic-gate'
console.log(and(true, false)); // false
console.log(or(true, false)); // true
console.log(not(true)); // false
console.log(xor(true, false)); // trueAPI Reference
| Function | Description |
| :--------| :---------------------------------------------------|
| and | Returns the logical AND of two boolean values. |
| or | Returns the logical OR of two boolean values. |
| not | Returns the logical NOT of the input boolean value. |
| xor | Returns the logical XOR of two boolean values. |
| nand | Returns the logical NAND of two boolean values. |
| nor | Returns the logical NOR of two boolean values. |
| xnor | Returns the logical XNOR of two boolean values. |
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License.
