# client-blobs-node

> Node.js / ES2017 client sdk for service-blobs microservice

Latest version **1.1.3** (published 2023-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install client-blobs-node
pnpm add client-blobs-node
yarn add client-blobs-node
bun add client-blobs-node
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2023-08-04 |
| First published | 2022-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 6 |
| Unpacked size | 857.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Conceptual Vision Consulting LLC |
| Maintainers | pipdeveloper |
| Keywords | pip.services, blobs, storage, microservice, client, sdk |

## Links

- npm: https://www.npmjs.com/package/client-blobs-node
- Repository: https://github.com/pip-services-infrastructure2/client-blobs-node
- Homepage: https://github.com/pip-services-infrastructure2/client-blobs-node#readme
- Issues: https://github.com/pip-services-infrastructure2/client-blobs-node/issues
- npm.io page: https://npm.io/package/client-blobs-node

## Dependencies (6)

- [service-blobs-node](https://npm.io/package/service-blobs-node.md) ^1.1.1
- [pip-services3-aws-nodex](https://npm.io/package/pip-services3-aws-nodex.md) ^1.1.*
- [pip-services3-rpc-nodex](https://npm.io/package/pip-services3-rpc-nodex.md) ^1.3.*
- [pip-services3-grpc-nodex](https://npm.io/package/pip-services3-grpc-nodex.md) ^1.1.*
- [pip-services3-commons-nodex](https://npm.io/package/pip-services3-commons-nodex.md) ^1.0.*
- [pip-services3-components-nodex](https://npm.io/package/pip-services3-components-nodex.md) ^1.4.*

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2023-08-04
- 1.1.2 — 2023-06-30
- 1.1.1 — 2023-02-27
- 1.1.0 — 2022-12-20
- 1.0.0 — 2022-05-06

## README

# Blobs Microservice Client SDK for Node.js / ES2017

This is a Node.js client SDK for [pip-services-storage](https://bitbucket.org/entinco/eic-services-infrastructure/src/master/service-blobs-node) microservice.
It provides an easy to use abstraction over communication protocols:

* HTTP/REST client
* Seneca client (see http://www.senecajs.org)
* AWS Lambda client
* Direct client for monolythic deploments
* S3 client to work with S3 storage directly
* Null client to be used in testing

<a name="links"></a> Quick Links:

* [Development Guide](doc/Development.md)
* [API Version 1](doc/NodeClientApiV1.md)

## Install

Add dependency to the client SDK into **package.json** file of your project
```javascript
{
    ...
    "dependencies": {
        ....
        "client-blobs-node": "^1.0.*",
        ...
    }
}
```

Then install the dependency using **npm** tool
```bash
# Install new dependencies
npm install

# Update already installed dependencies
npm update
```

## Use

Inside your code get the reference to the client SDK
```javascript
var sdk = new require('client-blobs-node');
```

Define client configuration parameters that match configuration of the microservice external API
```javascript
// Client configuration
var config = {
    connection: {
        protocol: 'http',
        host: 'localhost', 
        port: 8080
    }
};
```

Instantiate the client and open connection to the microservice
```javascript
// Create the client instance
var client = sdk.StorageRestClient(config);

// Connect to the microservice
try {
    await client.open(null);
    // Work with the microservice
    ...
} catch(err) {
    console.error('Connection to the microservice failed');
    console.error(err);
}
```

Now the client is ready to perform operations
```javascript
// Create a new picture
let blob = {
    group: "pictures",
    name: "google_search.jpg"
};

let blob = await client.createBlobFromUrl(
    null,
    blob,
    "https://www.google.com/logos/doodles/2016/doodle-4-google-2016-us-winner-5664555055185920-hp.jpg"
);
```

```javascript
// Start reading blobs in chunks
let blobData: BlobDataV1 = await client.getBlobDataById(
    null,
    blob_id
);
```    

## Acknowledgements

This client SDK was created and currently maintained by *Sergey Seroukhov*.

---
_Source: https://npm.io/package/client-blobs-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
