Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmtrs/beesly
Beesly makes interacting with HAL+JSON resources a joyful experience
https://github.com/dmtrs/beesly
Last synced: about 1 hour ago
JSON representation
Beesly makes interacting with HAL+JSON resources a joyful experience
- Host: GitHub
- URL: https://github.com/dmtrs/beesly
- Owner: dmtrs
- License: mit
- Created: 2017-02-14T10:54:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T19:42:56.000Z (almost 8 years ago)
- Last Synced: 2024-11-09T07:53:58.521Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://beesly.github.io
- Size: 104 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# beesly
> Beesly makes interacting with HAL+JSON resources a joyful experience
[![Build Status](https://img.shields.io/travis/beesly/beesly.svg?style=flat-square)](https://travis-ci.org/beesly/beesly)
[![Version](https://img.shields.io/npm/v/beesly.svg?style=flat-square)](https://www.npmjs.com/package/beesly)[Read the Documentation](https://beesly.github.io)
A modest example:
```js
import {Resource} from 'beesly';
import {Customer, LineItem} from './resources';export class Order extends Resource {
setup() {
this.hasOne('customer', {class: Customer});
this.hasMany('line_item', {class: LineItem, accessor: 'lineItems'});
}
}
``````js
import Order from './resources';var order = Order.get({id: 1000});
order.lineItems().forEach((item) => {
console.log(`${item.product().name}, ${item.quantity} units`);
})
```