-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
cp packages/alcaeus/README.md README.md | ||
git add README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Alcaeus [](https://badge.fury.io/js/alcaeus)  [](https://codecov.io/gh/wikibus/alcaeus) | ||
|
||
|
||
## [Hydra Core](http://www.hydra-cg.com/spec/latest/core/) library for JavaScript | ||
|
||
Alcaeus (pronounced <code>AL-SEE-UHS</code>) is a Node.js/browser library for consuming Hydra APIs. | ||
|
||
Alcaeus is the birth name of Heracles. The demigod who defeated Hydra. | ||
|
||
## Installation | ||
|
||
Use npm or yarn: | ||
|
||
``` bash | ||
npm i alcaeus | ||
``` | ||
|
||
## Requirements | ||
|
||
Alcaues `v3` is implemented only as ES Modules. It will work in recent versions on node and modern browsers. | ||
|
||
## Usage | ||
|
||
Since `v3` Alcaeus is configured using an RDF/JS Environment factory. This decouples the library from any specific RDF/JS implementation. | ||
|
||
It is recommended to use the implementation provided by `@zazuko/env` which allows to easily reuse extend existing environments. | ||
|
||
```js | ||
import create from 'alcaeus' | ||
import Environment from '@zazuko/env/Environment.js' | ||
import rdf from '@zazuko/env' | ||
|
||
const env = new Environment(create(), { parent: rdf }) | ||
|
||
const { response, representation } = await env.hydra.loadResource('http://example.com/resource'); | ||
const rootResource = representation.root; | ||
|
||
// contains supported classes, operations, etc. | ||
const apiDocs = Hydra.apiDocumentations[0]; | ||
|
||
const id = rootResource.id; | ||
``` | ||
|
||
To learn more, head to http://alcaeus.hydra.how. | ||
|
||
## License | ||
|
||
MIT | ||
|
||
[p1]: https://github.com/github/fetch | ||
[p3]: https://developer.mozilla.org/pl/docs/Web/JavaScript/Reference/Global_Objects/WeakMap |