{"_id":"mokshajs","_rev":"41-f902857d6b469b906fe3847fd2c02fc7","name":"mokshajs","dist-tags":{"latest":"1.1.4"},"versions":{"1.0.4":{"name":"mokshajs","version":"1.0.4","author":{"name":"kenseitehdev"},"license":"ISC","_id":"mokshajs@1.0.4","maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"dist":{"shasum":"68866b1f127cba930bf403402d1cb0699b7562eb","tarball":"https://registry.npmjs.org/mokshajs/-/mokshajs-1.0.4.tgz","fileCount":6,"integrity":"sha512-d0quqs/FzUuee6nvE0rCPFm/IQH2FcdPill2A2+v11Irk6sf/oZb+KS3oJeziNG1iOfJHAGDvR+yzJ2PnqOTew==","signatures":[{"sig":"MEUCID5T1fNcr9p8s1++l94JqfnOfIx2OYTa1F+BUVfNIbzEAiEAiM5McbJGi/4PsH5Srs5LEdqyV7t43vNeKvcPxj2LNsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":58376},"main":"moksha.js","type":"module","gitHead":"ef8a6e7e195af47487164879b6cb937866bfa221","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kenseitehdev","email":"tehkensei@gmail.com"},"_npmVersion":"10.5.0","description":"ultra lightweight, robust frontend micro-library","directories":{},"_nodeVersion":"20.12.2","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mokshajs_1.0.4_1731079846807_0.5496514104450749","host":"s3://npm-registry-packages"}},"1.0.9":{"name":"mokshajs","version":"1.0.9","author":{"name":"kenseitehdev"},"license":"ISC","_id":"mokshajs@1.0.9","maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"dist":{"shasum":"aec56d5993994ed8d45701ed64b7b9632dab7085","tarball":"https://registry.npmjs.org/mokshajs/-/mokshajs-1.0.9.tgz","fileCount":6,"integrity":"sha512-hQbulJs0q9JbN469koClOiFj8Ccq2Fb5AehyaEoits2APdDZcCqiJdlKz440gnHAdtOxXh+TtPtuM9BajlN7dA==","signatures":[{"sig":"MEUCIQDLoBWOiPqvyi6JH/eHsV4J6Dr0C//UYn1RBIdkMWYmhAIgXygW/0LHL/2x/aQoda3Ap62mLNYoQYvJHp9s7KsXXT0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71361},"main":"moksha.js","type":"module","gitHead":"ef8a6e7e195af47487164879b6cb937866bfa221","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kenseitehdev","email":"tehkensei@gmail.com"},"_npmVersion":"10.5.0","description":"ultra lightweight, robust frontend micro-library","directories":{},"_nodeVersion":"20.12.2","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mokshajs_1.0.9_1731203847921_0.58055628123141","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"mokshajs","version":"1.1.1","author":{"name":"kenseitehdev"},"license":"ISC","_id":"mokshajs@1.1.1","maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"dist":{"shasum":"ebc7904cf695e0fbac5de16e797bdc3686a016b4","tarball":"https://registry.npmjs.org/mokshajs/-/mokshajs-1.1.1.tgz","fileCount":8,"integrity":"sha512-Uf+Mvg/bYksq/Oq60Rjo7CDwc2jOktabus+0ytZwSAUNbClPnFiLt3PkMauec2eUd7eRsblAaB/rGAg0BeBYvA==","signatures":[{"sig":"MEUCID/Xu+pPRoqcu99vJr1gWDeRa+zMwHjJNayG/ZIScBYZAiEA1jnqryCtm4j2Mh369+myawgubNrzxBfH/oEqTUE3Za0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":180053},"main":"moksha.js","type":"module","gitHead":"ef8a6e7e195af47487164879b6cb937866bfa221","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kenseitehdev","email":"tehkensei@gmail.com"},"_npmVersion":"10.8.3","description":"ultra lightweight, robust frontend micro-library","directories":{},"_nodeVersion":"20.17.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mokshajs_1.1.1_1732637898272_0.27272481764939593","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"mokshajs","version":"1.1.2","author":{"name":"kenseitehdev"},"license":"ISC","_id":"mokshajs@1.1.2","maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"dist":{"shasum":"9ba10729c14f621b7b25c2610544d1d6dbf41505","tarball":"https://registry.npmjs.org/mokshajs/-/mokshajs-1.1.2.tgz","fileCount":9,"integrity":"sha512-KpJISfRNrtC8y5AW0XXwnpVdoRqvxV2K6ffhLKHyZh7u8rYgpf7Llr/9LU7PdrQCG1vSiTBdJ8HKEPqAB3SdwQ==","signatures":[{"sig":"MEUCIQCA7OQnxDlPXgXo+Yox2R9mAxrI11tcLKwRcKfh2X7l+QIgFg/7omVa/AlSzWVn4pbMTnbaC607xGuKNwb+MJ+K31w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":333678},"main":"moksha.js","type":"module","gitHead":"ef8a6e7e195af47487164879b6cb937866bfa221","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kenseitehdev","email":"tehkensei@gmail.com"},"_npmVersion":"10.8.3","description":"ultra lightweight, robust frontend micro-library","directories":{},"_nodeVersion":"20.17.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mokshajs_1.1.2_1732731537897_0.9410893517947916","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"mokshajs","version":"1.1.3","author":{"name":"kenseitehdev"},"license":"ISC","_id":"mokshajs@1.1.3","maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"dist":{"shasum":"d3f976d3f36b2b9b3c2ab3c357ead3421e0837b4","tarball":"https://registry.npmjs.org/mokshajs/-/mokshajs-1.1.3.tgz","fileCount":10,"integrity":"sha512-GZ2tYfGqfWOfoG3pHRpN0bvPSCwGQzM7BC0p82vPPeb/HLTYo2ff/4VnnBt/6s5Dts2hu9FXynQBe4/ICVzikw==","signatures":[{"sig":"MEYCIQCamhxEpUYwuTj9bS/iKE13bLK/ZURKZwpO9cyYkl8ZzwIhAMHj5TZgWZ5pzhmo4RnXZGfDQILrS6oNmW0DNqbDQbKr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":633110},"main":"moksha.js","type":"module","gitHead":"ef8a6e7e195af47487164879b6cb937866bfa221","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"kenseitehdev","email":"tehkensei@gmail.com"},"_npmVersion":"10.8.3","description":"ultra lightweight, robust frontend micro-library","directories":{},"_nodeVersion":"20.17.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mokshajs_1.1.3_1732991054951_0.7943601481699107","host":"s3://npm-registry-packages"}},"1.1.4":{"name":"mokshajs","version":"1.1.4","type":"module","description":"ultra lightweight, robust frontend micro-library","main":"moksha.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"kenseitehdev"},"license":"ISC","publishConfig":{"registry":"https://registry.npmjs.org/"},"dependencies":{"express":"^4.21.2"},"_id":"mokshajs@1.1.4","gitHead":"6232cdfd9cba33cd7234afb703dc13993d318491","_nodeVersion":"23.7.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-ZI/kVAO9oOd3xczXv8Wqu7ooxxXD1CNZm7CPWWtjVurkRYyVNy8X79g6tenCR1qCGo19660amqol591QIHWfzg==","shasum":"a6d648c996ad13240c85d8da50787ce87e7d77f9","tarball":"https://registry.npmjs.org/mokshajs/-/mokshajs-1.1.4.tgz","fileCount":6,"unpackedSize":64579,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCyga2EPZq8TeqILu/jTEMLKOQBH8GNfWtHo5hbvgbhzAIhAJJKNYRBIPPnNiiBzuhBk1Lk+kxLMaplUPhS9ndMBoZN"}]},"_npmUser":{"name":"kenseitehdev","email":"tehkensei@gmail.com"},"directories":{},"maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mokshajs_1.1.4_1740424554866_0.19981543160556026"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-08T15:30:46.806Z","modified":"2025-02-24T19:15:55.222Z","0.9.5":"2024-10-11T04:49:17.849Z","0.9.6":"2024-10-15T21:29:22.551Z","0.9.7":"2024-10-15T21:32:11.118Z","1.0.0":"2024-10-17T05:47:50.716Z","1.0.1":"2024-10-17T14:39:44.763Z","1.1.0":"2024-10-18T06:28:14.516Z","1.2.0":"2024-10-18T12:46:55.394Z","1.2.1":"2024-10-19T21:29:49.924Z","1.2.2":"2024-10-19T21:33:57.473Z","1.3.0":"2024-10-24T14:03:31.878Z","1.3.1":"2024-10-24T19:20:33.930Z","1.4.0":"2024-10-24T23:10:40.247Z","1.4.3":"2024-10-26T04:32:05.915Z","1.4.5":"2024-10-27T01:22:01.224Z","1.5.0":"2024-10-31T10:07:34.126Z","1.6.0":"2024-10-31T13:06:50.294Z","1.6.1":"2024-11-03T03:18:23.667Z","1.6.5":"2024-11-04T05:07:06.433Z","1.6.6":"2024-11-04T05:25:13.587Z","1.6.7":"2024-11-04T05:32:22.457Z","1.6.8":"2024-11-04T05:35:32.442Z","1.6.9":"2024-11-04T05:40:33.136Z","1.7.0":"2024-11-05T16:41:36.016Z","1.7.1":"2024-11-06T17:15:39.277Z","1.0.4":"2024-11-08T15:30:47.085Z","1.0.5":"2024-11-08T15:32:24.141Z","1.0.6":"2024-11-09T21:05:07.758Z","1.0.7":"2024-11-09T21:11:23.857Z","1.0.8":"2024-11-09T21:18:45.069Z","1.0.9":"2024-11-10T01:57:28.135Z","1.1.1":"2024-11-26T16:18:18.493Z","1.1.2":"2024-11-27T18:18:58.171Z","1.1.3":"2024-11-30T18:24:15.226Z","1.1.4":"2025-02-24T19:15:55.059Z"},"author":{"name":"kenseitehdev"},"license":"ISC","description":"ultra lightweight, robust frontend micro-library","maintainers":[{"name":"kenseitehdev","email":"tehkensei@gmail.com"}],"readme":"# MokshaJS Documentation\n\n## Overview\nMokshaJS is an ultra-lightweight frontend library designed for building reactive applications. This documentation provides an overview of the main classes and functions included in the library.\n\n## Table of Contents\n- [Batch](#batch)\n- [Reactive](#reactive)\n- [Store](#store)\n- [EventBus](#eventbus)\n- [Error Handling](#error-handling)\n- [Component Management](#component-management)\n- [Selector](#selector)\n- [VNode](#vnode)\n- [Utilities](#utilities)\n- [Platform Detection](#platform-detection)\n- [Global Methods](#global-methods)\n\n---\n\n## Batch\n\n### Description\nThe `Batch` class manages a queue of update functions that need to be executed. It allows batching of updates to improve performance by minimizing DOM reflows.\n\n### Methods\n- **add(updateFunction)**: Adds an update function to the batch and schedules a flush.\n- **scheduleFlush()**: Schedules the flush operation if not already flushing.\n- **flush()**: Executes all queued update functions in the next animation frame.\n\n---\n\n## Reactive\n\n### Description\nThe `Reactive` class enables the creation of reactive states that notify subscribers upon changes.\n\n### Methods\n- **constructor()**: Initializes the reactive instance with an empty set of subscribers.\n- **subscribe(callback)**: Adds a callback to the subscribers list.\n- **unsubscribe(callback)**: Removes a callback from the subscribers list.\n- **notify()**: Notifies all subscribers to execute their callbacks.\n- **createReactiveState(initialState)**: Creates a reactive state using a proxy to track changes.\n\n---\n\n## Store\n\n### Description\nThe `Store` class manages application state, allowing for namespaces and derived states.\n\n### Methods\n- **constructor(initialState)**: Initializes the store with a reactive state and optional initial state.\n- **createNamespace(namespace, initialState)**: Creates a new namespace in the store.\n- **subscribe(namespace, listener)**: Subscribes a listener to changes in a namespace.\n- **derive(namespace, deriveFunction)**: Creates a derived state based on a namespace.\n- **getDerived(namespace)**: Retrieves the derived state for a namespace.\n- **setState(newValues)**: Sets new values for the state.\n- **getState(namespace)**: Retrieves the state for a namespace.\n\n---\n\n## EventBus\n\n### Description\nThe `EventBus` class facilitates event-driven communication between components.\n\n### Methods\n- **constructor()**: Initializes the event bus with an empty listeners object.\n- **on(event, listener)**: Subscribes a listener to a specific event.\n- **emit(event, ...args)**: Emits an event, calling all subscribed listeners.\n- **off(event, listener)**: Unsubscribes a listener from an event.\n- **clear(event)**: Clears all listeners for a specific event.\n\n---\n\n## Error Handling\n\n### Description\nThe `Error` class provides static methods for logging warnings and errors.\n\n### Methods\n- **logWarning(warning)**: Logs a warning message with a timestamp.\n- **logError(error)**: Logs an error message with a timestamp.\n- **handler(error)**: Centralizes error handling and logging.\n\n---\n\n## Component Management\n\n### Description\nThe `defineComponent` function creates custom HTML elements with lifecycle methods and state management.\n\n### Parameters\n- **name**: The name of the custom element.\n- **template**: The HTML template for the component.\n- **connectedCallback**: A callback executed when the component is connected to the DOM.\n- **props**: Initial properties for the component.\n- **methods**: Methods available in the component instance.\n\n---\n\n## Selector\n\n### Description\nThe `Selector` class provides methods for DOM manipulation and querying.\n\n### Methods\n- **constructor(selector, option)**: Initializes a selector with the specified selector string.\n- **_getElements(selector, option)**: Retrieves elements matching the selector.\n- **removeAllChildren()**: Removes all child elements from the selected elements.\n- **css(styles)**: Applies CSS styles to the selected elements.\n- **html(content)**: Sets the inner HTML of the selected elements.\n- **text(content)**: Sets the inner text of the selected elements.\n- **attributes(action, key, value)**: Gets or sets attributes for the selected elements.\n- **removeChild(childElements)**: Removes specified child elements from the selected elements.\n- **value(action, val)**: Gets or sets the value of input elements.\n- **children()**: Retrieves child elements of the selected elements.\n- **index()**: Gets the index of the selected elements among their siblings.\n- **map(callback)**: Maps over selected elements and applies a callback.\n- **parent()**: Retrieves parent elements of the selected elements.\n- **classList(action, classes)**: Adds or removes classes from the selected elements.\n- **reset()**: Resets the selector to its original state.\n- **appendChild(childElement)**: Appends child elements to the selected elements.\n- **on(event, callback)**: Adds event listeners to the selected elements.\n- **_getAllElements()**: Retrieves all elements from the document body.\n- **redraw()**: Redraws the selected elements in the DOM.\n\n---\n\n## VNode\n\n### Description\nThe `VNode` class represents a virtual DOM node.\n\n### Properties\n- **tag**: The tag name of the virtual node.\n- **props**: The properties of the virtual node.\n- **children**: The children of the virtual node.\n- **key**: A unique key for the virtual node.\n- **el**: The actual DOM element associated with the virtual node.\n\n---\n\n## Utilities\n\n### throttle(func, limit)\nThrottles a function to ensure it runs at most once within the specified limit.\n\n### debounce(func, wait)\nDebounces a function to ensure it only runs after the specified wait time has elapsed.\n\n---\n\n## Platform Detection\n\n### Description\nDetects the platform on which the application is running.\n\n### Methods\n- **getPlatform()**: Returns the platform name.\n- **isWindows()**: Checks if the platform is Windows.\n- **isMac()**: Checks if the platform is macOS.\n- **isLinux()**: Checks if the platform is Linux.\n- **isAndroid()**: Checks if the platform is Android.\n- **isIpad()**: Checks if the platform is iPad.\n- **isIphone()**: Checks if the platform is iPhone.\n\n---\n\n## Global Methods\n\n### selector(selector)\nCreates a new `Selector` instance.\n\n### store(state)\nCreates a new `Store` instance.\n\n### eventHandler(handler)\nCreates a new `EventHandler` instance.\n\n### reactive(reactive)\nCreates a new `Reactive` instance.\n\n### compManager(compManager)\nCreates a new `ComponentManager` instance.\n\n### lazyLoad(componentPath)\nDynamically imports and appends a component to the application.\n\n---\n\nThis documentation serves as a reference for developers using MokshaJS. For further questions or contributions, please refer to the project's [GitHub repository](https://github.com/YOUR_REPO_URL).\n","readmeFilename":"README.md"}