{"_id":"@2toad/reflex","name":"@2toad/reflex","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@2toad/reflex","version":"1.0.0","description":"A simple approach to state management","homepage":"https://github.com/2Toad/reflex","author":{"name":"2Toad"},"license":"MIT","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js","default":"./dist/esm/index.js"}},"sideEffects":false,"scripts":{"clean":"npx rimraf dist","build":"npm run clean && npm run build:cjs && npm run build:esm && npm run build:types","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","build:types":"tsc -p tsconfig.types.json","local":"npm run clean && nodemon src/index.ts","local:pack":"npm run build && npm pack","test":"mocha -r ts-node/register tests/unit/*.spec.ts","test:watch":"mocha -r ts-node/register --watch --watch-files tests --watch-extensions ts 'tests/unit/*.spec.ts'","test:e2e":"npm run build && playwright test","test:e2e:ui":"playwright test --ui","test:e2e:debug":"playwright test --debug","test:package":"./test-package.sh","test:all":"npm run test && npm run test:e2e && npm run test:package","lint":"eslint . --cache","lint:fix":"eslint . --fix","format":"prettier . --write","prepublishOnly":"npm run lint && npm run test:all","postinstall":"husky"},"repository":{"type":"git","url":"git+ssh://git@github.com/2Toad/reflex.git"},"keywords":["reflex","reactive","computed","deep-reactive","state-management","typescript","framework-agnostic","zero-dependencies","reactivity","observable","proxy","subscription","batch-updates"],"devDependencies":{"@eslint/js":"^9.9.1","@playwright/test":"^1.50.1","@types/chai":"^5.0.1","@types/eslint__js":"^8.42.3","@types/eslint-config-prettier":"^6.11.3","@types/eslint-plugin-security":"^3.0.0","@types/mocha":"^10.0.8","@types/node":"^22.5.2","@typescript-eslint/eslint-plugin":"^8.4.0","@typescript-eslint/parser":"^8.4.0","chai":"^5.2.0","eslint":"^9.9.1","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.1","eslint-plugin-security":"^3.0.1","globals":"^16.0.0","husky":"^9.1.5","lint-staged":"^15.2.10","mocha":"^11.1.0","nodemon":"^3.1.4","prettier":"^3.3.3","rimraf":"^6.0.1","ts-node":"^10.9.2","typescript":"^5.5.4","typescript-eslint":"^8.4.0"},"overrides":{"inflight":"^2.0.0","glob":"^9.0.0"},"lint-staged":{"*.ts":"eslint --cache --fix","*":"prettier --write"},"_id":"@2toad/reflex@1.0.0","gitHead":"a4a90f49ae24edb9cbe48a74badf4327455c9537","bugs":{"url":"https://github.com/2Toad/reflex/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Dz0hM+DMr1U+HsmwMHXvRWn2CLVkjUDiDdkEAbDtHEjwPMIEX166vKQN3rvEuLgeuT8lNrNyGo9n9eYGwMlDPw==","shasum":"9c51890a2ef0bc1fba5d1916e055d711d07bd6b8","tarball":"https://registry.npmjs.org/@2toad/reflex/-/reflex-1.0.0.tgz","fileCount":45,"unpackedSize":199159,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE9B9+pIiWE/+xL6j1pMeyTbJ5bwL48tvKuetVJg/ZreAiBW4/64JLXmKFc4MgeaaL5gWaiPDz0FtfzkquyuMaAnzQ=="}]},"_npmUser":{"name":"jasonpierce","email":"support@2toad.com"},"directories":{},"maintainers":[{"name":"jasonpierce","email":"support@2toad.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/reflex_1.0.0_1740344948628_0.2192428931263144"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-23T21:09:08.521Z","1.0.0":"2025-02-23T21:09:08.839Z","modified":"2025-02-23T21:09:09.333Z"},"maintainers":[{"name":"jasonpierce","email":"support@2toad.com"}],"description":"A simple approach to state management","homepage":"https://github.com/2Toad/reflex","keywords":["reflex","reactive","computed","deep-reactive","state-management","typescript","framework-agnostic","zero-dependencies","reactivity","observable","proxy","subscription","batch-updates"],"repository":{"type":"git","url":"git+ssh://git@github.com/2Toad/reflex.git"},"author":{"name":"2Toad"},"bugs":{"url":"https://github.com/2Toad/reflex/issues"},"license":"MIT","readme":"# Reflex ⚡\n\nA unique and refreshingly simple approach to state management.\n\n![GitHub Release](https://img.shields.io/github/v/release/2Toad/reflex)\n[![Downloads](https://img.shields.io/npm/dm/@2toad/reflex.svg)](https://www.npmjs.com/package/@2toad/reflex)\n[![Build status](https://github.com/2toad/reflex/actions/workflows/ci.yml/badge.svg)](https://github.com/2Toad/reflex/actions/workflows/nodejs.yml)\n\nWhether you're building browser applications, Node.js services, or CLI tools, Reflex helps you handle your data elegantly. Works with any framework (React, Vue, Angular) or vanilla JavaScript.\n\n👉 [Why choose Reflex?](./docs/why-reflex.md)\n\n## Quick Start\n\n1. Install the package:\n```bash\nnpm i @2toad/reflex\n```\n\n2. Create and use a reactive value:\n```typescript\nimport { reflex } from '@2toad/reflex';\n\n// Create a reactive value\nconst counter = reflex({ initialValue: 0 });\n\n// Listen for changes\ncounter.subscribe(value => {\n  console.log('Counter is now:', value);\n});\n\n// Update the value\ncounter.setValue(1);\n```\n\n## Key Features\n\n- 🪶 **Simple to Use** - Start managing state in minutes\n- 🎯 **Works Everywhere** - Use with any JavaScript framework or vanilla JS\n- ⚡ **Fast & Efficient** - Only updates when values actually change\n- 🧮 **Smart Calculations** - Compute values based on other values automatically\n- 🔄 **Async Ready** - Built-in support for async operations\n- 🛡️ **Safe & Reliable** - Prevents common pitfalls and memory leaks\n\n## Common Use Cases\n\n### Basic Value Management\n```typescript\nconst username = reflex({ initialValue: '' });\nusername.subscribe(name => updateUI(name));\n```\n\n### Computed Values\n```typescript\nconst price = reflex({ initialValue: 10 });\nconst quantity = reflex({ initialValue: 2 });\nconst total = computed([price, quantity], ([p, q]) => p * q);\n```\n\n### Complex Objects\n```typescript\nconst user = deepReflex({\n  profile: {\n    name: 'John',\n    settings: { theme: 'dark' }\n  }\n});\n```\n\n## Want to learn more?\nStart here to learn the basics and get a solid foundation:\n\n- [Why Reflex?](./docs/why-reflex.md) - Understanding Reflex's unique approach\n- [Features Guide](./docs/features.md) - Core features and basic usage\n- [Advanced Usage](./docs/advanced-usage.md) - Complex patterns and techniques\n- [Best Practices](./docs/best-practices.md) - Guidelines for clean, efficient code\n- [Performance Tips](./docs/performance.md) - Optimization strategies\n- [API Reference](./docs/api-reference.md) - Complete API documentation\n\nDetailed guides for specific features:\n\n- [Backpressure Handling](./docs/backpressure.md) - Managing high-frequency updates\n- [Batch Operations](./docs/batch-operations.md) - Efficient bulk updates\n- [Computed Values](./docs/computed-values.md) - Deriving state\n- [Deep Reactivity](./docs/deep-reactivity.md) - Nested object reactivity\n- [Operators](./docs/operators.md) - Transform and combine values\n\n## Contributing\n\nWe welcome contributions! See our [Contributing Guide](./docs/contribute.md) to get started. ","readmeFilename":"README.md"}