New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lucid-ts-sdk

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lucid-ts-sdk - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

5

lib/index.d.ts

@@ -0,1 +1,2 @@

import 'isomorphic-fetch';
/** Lucid API wrapper */

@@ -32,7 +33,9 @@ export declare class LucidAPI {

* Initialize the Lucid API wrapper instance.
*
* Checks the Lucid API endpoint is valid and get its version.
*
* Checks the Lucid API endpoint authentification JSON Web Token if it was provided.
*
* @returns Lucid API endpoint version
* @throws {Error} Instance already initialized - Invalid endpoint
* @throws {Error} Instance already initialized - Invalid endpoint - Invalid JWT
*/

@@ -39,0 +42,0 @@ init(): Promise<string>;

15

lib/index.js
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// Make fetch work with node and browser
const e6p = __importStar(require("es6-promise"));
e6p.polyfill();
require("isomorphic-fetch");
/** Lucid API wrapper */

@@ -31,7 +42,9 @@ class LucidAPI {

* Initialize the Lucid API wrapper instance.
*
* Checks the Lucid API endpoint is valid and get its version.
*
* Checks the Lucid API endpoint authentification JSON Web Token if it was provided.
*
* @returns Lucid API endpoint version
* @throws {Error} Instance already initialized - Invalid endpoint
* @throws {Error} Instance already initialized - Invalid endpoint - Invalid JWT
*/

@@ -38,0 +51,0 @@ async init() {

{
"name": "lucid-ts-sdk",
"version": "0.1.0",
"version": "0.1.1",
"description": "Lucid KV TypeScript wrapper 🍬 High performance and distributed KV store accessible through an HTTP API.",

@@ -25,4 +25,6 @@ "main": "lib/index.js",

"build": "tsc",
"docs": "rm -rf docs && typedoc --out docs src && touch docs/.nojekyll",
"docs-publish": "yarn docs && gh-pages -d docs -t && rm -rf docs",
"test": "echo No tests available yet",
"prepare": "yarn test && yarn build"
"prepublishOnly": "yarn test && yarn build"
},

@@ -37,7 +39,14 @@ "homepage": "https://github.com/lucid-kv/ts-sdk#readme",

},
"author": "rigwild <contact@asauvage.fr>",
"author": "rigwild <me@rigwild.dev> (https://rigwild.dev/)",
"license": "MIT",
"dependencies": {
"es6-promise": "^4.2.8",
"isomorphic-fetch": "^2.2.1"
},
"devDependencies": {
"@types/isomorphic-fetch": "^0.0.35",
"gh-pages": "^2.1.1",
"typedoc": "^0.15.0",
"typescript": "^3.6.4"
}
}
# Lucid TypeScript SDK
[![npm](https://img.shields.io/npm/v/lucid-ts-sdk?label=npm)](https://www.npmjs.com/package/lucid-ts-sdk)
[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/lucid-kv/ts-sdk/blob/master/LICENSE)
Lucid KV TypeScript wrapper 🍬 High performance and distributed KV store accessible through an HTTP API.
This packages uses [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) to make sure it works on both the browser and Node.js.
## Install
```sh
yarn add lucid-ts-sdk
```
## Usage
```ts
import { LucidAPI } from 'lucid-ts-sdk'
const setup = async () => {
// Create a Lucid API wrapper instance
const Lucid = new LucidAPI('http://127.0.0.1:7020', 'your-Lucid-authentication-JSON-Web-Token')
// Initialize the wrapper instance (validate endpoint and JWT)
const version = await Lucid.init()
console.log(version) // 0.1.2
const content = await Lucid.getKey('check-token').then(res => res.json())
console.log(content) // { code: 0, message: 'Lucid Version 0.1.2', details: null }
}
setup()
```
## SDK API documentation
https://lucid-kv.github.io/ts-sdk/
## License
[The MIT License](./LICENSE)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc