@renyuneyun/solid-helper
v0.2.0
Published
Common helpers for developing SoLiD (Social Linked Data) under JS/TS
Readme
Solid Helper
This repo contains common helpers for developing SoLiD (Social Linked Data) Apps with JS/TS.
It emerged from my personal requirements, because I routinely or predictively need some functionalities.
Docs
Under construction...
For the time being, please see index.ts for exported functions and types. They are mainly:
getUserInfo(): Get some common information of the WebID (avatar, name, etc).findStorage(): Get the Pod / storage (recursively up) from the specified URL. Mainly used when WebID does not havespace:storagespecified.isStorageInLinkHeader(): Identify if the given URL is a storage based on theLinkheader, of the given URL.isStorageInLinkHeaderString(): Identify if the given URL is a storage based on theLinkheader.
Test
This repo comes with simple / naive unit tests and end-to-end (E2E) tests, under test/.
Remember to run npm run build first before testing.
Unit test
To run the unit test:
npm testE2E test
To run the E2E test:
POD_URL='https://YOUR-POD-URL/' npm run test-e2eSee document inside the file (test/e2e/test.js) for more details.
