https://github.com/datopian/giftless-client-js
A JS client for the Giftless git-lfs server https://github.com/datopian/giftless
https://github.com/datopian/giftless-client-js
Last synced: 8 months ago
JSON representation
A JS client for the Giftless git-lfs server https://github.com/datopian/giftless
- Host: GitHub
- URL: https://github.com/datopian/giftless-client-js
- Owner: datopian
- License: mit
- Created: 2020-12-18T18:01:35.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-15T11:52:10.000Z (about 5 years ago)
- Last Synced: 2025-05-09T10:08:03.192Z (9 months ago)
- Language: JavaScript
- Homepage: https://tech.datopian.com/giftless/
- Size: 387 KB
- Stars: 7
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# giftless-client-js
[](http://opensource.org/licenses/MIT)
Javascript implementation of [giftless-client](https://github.com/datopian/giftless-client)
## Installation
You can install directly from npm:
```bash
$ npm i giftless-client
```
## API
This implementation of giftless-client exposes a main class called `Client` which contains a low-level LFS API commands callled `batch`.
### instantiating Client
```js
import { Client } from "giftless-client";
client = new Client("https://git-lfs.example.com", "somer4nd0mT0ken==", [
"basic",
]);
```
### Sending an LFS batch API request
```js
client.batch(
"myorg/myrepo",
"download",
[
{
oid: "12345678",
size: 123,
}
]
)
);
```
### Upload to Gitless LFS Server
Resources can be uploaded to lfs server using the client upload method `upload(file, organisationId, datasetId, onProgress)`
```js
import { open } from 'frictionlessjs`;
const file = open('/path/resource.csv');
await client.upload(file, 'my-org','dataset-name');
```
## License
Giftless Client Javascript is free software distributed under the terms of the MIT license. See [LICENSE](LICENSE) for details.
Giftless Client Javascript is (c) 2020 Datopian / Viderum Inc.