Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lenra-io/app-lib-js
Lenra's app lib for JavaScript and TypeScript apps
https://github.com/lenra-io/app-lib-js
app-lib javascript lenra typescript
Last synced: about 1 month ago
JSON representation
Lenra's app lib for JavaScript and TypeScript apps
- Host: GitHub
- URL: https://github.com/lenra-io/app-lib-js
- Owner: lenra-io
- License: mit
- Created: 2023-04-13T14:47:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T11:50:58.000Z (about 2 months ago)
- Last Synced: 2024-10-31T18:56:07.267Z (about 2 months ago)
- Topics: app-lib, javascript, lenra, typescript
- Language: TypeScript
- Homepage:
- Size: 358 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
App Lib for javaScript based projects
This lib integrates Express server and all the elements the app needs in order to only keep the views, listeners and resources in the app project.
Report Bug
·
Request Feature
## Usage
To incorporate it into your Lenra app project, simply run the following command:
```console
npm i @lenra/app-server
```### Lenra API calls
To call a Lenra API from a listener, utilize the `Api` instance provided as the third parameter in your listener function.
You can then create a document using the data API with the following code:
```js
class CustomType extends Data {
/**
* @param {string} value
*/
constructor(value) {
this.value = value;
}
}const myDoc = await api.data.coll(CustomType).createDoc(new CustomType("Hello world"));
```## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please open an issue with the tag "enhancement".
Don't forget to give the project a star if you liked it! Thanks again!generate### Generate classes
A part of this lib is generated from the [Lenra API](https://github.com/lenra-io/api).
To generate the classes, run the following commands:```bash
# Load API
## With wget
wget https://github.com/lenra-io/api/releases/latest/download/load-api.sh -O - -q | bash
## With curl
curl -fsSL https://github.com/lenra-io/api/releases/latest/download/load-api.sh | bash
# generate
npm run generate
```## License
Distributed under the **MIT** License. See [LICENSE](./LICENSE) for more information.
## Contact
Lenra - [@lenra_dev](https://twitter.com/lenra_dev) - [email protected]
Project Link: [https://github.com/lenra-io/app-lib-js](https://github.com/lenra-io/app-lib-js)
[contributors-shield]: https://img.shields.io/github/contributors/lenra-io/app-lib-js.svg?style=for-the-badge
[contributors-url]: https://github.com/lenra-io/app-lib-js/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/lenra-io/app-lib-js.svg?style=for-the-badge
[forks-url]: https://github.com/lenra-io/app-lib-js/network/members
[stars-shield]: https://img.shields.io/github/stars/lenra-io/app-lib-js.svg?style=for-the-badge
[stars-url]: https://github.com/lenra-io/app-lib-js/stargazers
[issues-shield]: https://img.shields.io/github/issues/lenra-io/app-lib-js.svg?style=for-the-badge
[issues-url]: https://github.com/lenra-io/app-lib-js/issues
[license-shield]: https://img.shields.io/github/license/lenra-io/app-lib-js.svg?style=for-the-badge
[license-url]: https://github.com/lenra-io/app-lib-js/blob/master/LICENSE