{"id":22064710,"url":"https://github.com/ldarren/lean","last_synced_at":"2026-05-17T01:47:03.244Z","repository":{"id":19446084,"uuid":"22690120","full_name":"ldarren/lean","owner":"ldarren","description":"lean ui","archived":false,"fork":false,"pushed_at":"2023-08-29T15:23:32.000Z","size":192,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T18:14:01.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ldarren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-06T16:36:31.000Z","updated_at":"2021-11-08T01:30:35.000Z","dependencies_parsed_at":"2023-01-11T20:28:03.810Z","dependency_job_id":null,"html_url":"https://github.com/ldarren/lean","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ldarren/lean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Flean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Flean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Flean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Flean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldarren","download_url":"https://codeload.github.com/ldarren/lean/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Flean/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265224102,"owners_count":23730340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T19:13:17.153Z","updated_at":"2026-05-17T01:46:58.224Z","avatar_url":"https://github.com/ldarren.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lean JavaScript Library\n\nLean is a lightweight JavaScript library that provides various utility functions and features for web development. It includes functionality for handling events, local storage, DOM manipulation, AJAX requests, and more.\n\n## Features\n\n- **Event Handling**: Lean provides event handling functions to simplify event management. It includes support for common events such as click, tap, long tap, and more.\n\n- **Local Storage**: Lean offers a simple API for working with local storage. It supports both the native `localStorage` API and the `sqlitePlugin` for SQLite-based local storage.\n\n- **DOM Manipulation**: Lean provides functions for creating and manipulating DOM elements. It allows you to set element attributes, classes, styles, and content easily.\n\n- **AJAX Requests**: Lean includes a lightweight AJAX function for making HTTP requests. It supports GET, POST, PUT, DELETE, and PATCH methods and provides options for handling query parameters, headers, and more.\n\nFor making AJAX requests in Node.js, you can use the ajax function provided by the [picos-util](https://github.com/ldarren/picos-util) library. The ajax function in picos-util has the same input parameters and output response format as the AJAX function in Lean.\n\n## Installation\n\nbuild commands\n* ./build # compile less to css\n* ./concat \u003c output.js \u003e \u003c src/dir \u003e # combine js files to single js\n\nTo use Lean in your project, include the `lean.min.js` file in your HTML:\n\n```html\n\u003cscript src=\"path/to/lean.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nHere's an example of how to use some of the features provided by Lean:\n\n```javascript\n// Event Handling\ndocument.addEventListener('click', function(event) {\n  console.log('Clicked:', event.target);\n});\n\n// Local Storage\n__.store('localstorage').setItem('username', 'John Doe', function(error, id) {\n  if (error) {\n    console.error('Error:', error);\n    return;\n  }\n  console.log('Item saved with ID:', id);\n});\n\n__.store('localstorage').getItem('username', function(error, value) {\n  if (error) {\n    console.error('Error:', error);\n    return;\n  }\n  console.log('Username:', value);\n});\n\n// DOM Manipulation\nvar element = __.dom.get({ tag: 'div', id: 'my-element', content: 'Hello, world!' });\ndocument.body.appendChild(element);\n\n// AJAX Requests\n__.ajax('get', 'https://api.example.com/data', null, {}, function(error, state, responseBody, response, userData) {\n\tif (state !== 4) return // for response streaming\n  if (error) {\n    console.error('Error:', error);\n    return;\n  }\n  console.log('Response:', responseBody);\n}, userData);\n```\n\nNote: The above code is a minified version of Lean. It's recommended to use the unminified version during development for better readability and debugging.\n\n## Documentation\n\nFor detailed documentation and usage examples, refer to the [Lean GitHub repository](https://github.com/ldarren/lean)\n\n## License\n\nLean is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldarren%2Flean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldarren%2Flean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldarren%2Flean/lists"}