Code Monkey home page Code Monkey logo

coa-ali-ots's Introduction

coa-ali-ots

GitHub license npm version npm downloads PRs Welcome

轻量的阿里云 TableStore 封装 for Node.js。基于 tablestore 做简单处理。

根据日常实际项目使用情况,封装了一些个人常用的的方法。此方法在特殊场景下使用,不具有普遍性。

快速开始

安装

yarn add coa-ali-ots

使用

import { AliOtsBin, AliOtsStorage, AliOtsVersion } from 'coa-ali-ots'

// TableStore配置
const config = {
  accessKeyId: 'LTAI4XXXXXXXXX1DNpZDk',
  accessKeySecret: 'TxqDw89E3wXXXXXXXXXXXXoWZy2hXvZ',
  instance: 'instance-name',
  endpoint: 'https://instance-name.cn-shanghai.ots.aliyuncs.com',
}

// 初始化bin实例
const bin = new AliOtsBin(config)

// 创建Version实例
const otsVersion = new AliOtsVersion(bin)

// 根据项目名称返回一个新的版本号
await otsVersion.new('name') // 1

// 创建存储实例
const otsStorage = new AliOtsStorage(bin)

// 设置存储
await otsStorage.set('key1', 'data1')
// 读取存储
await otsStorage.get('key1') // "data1"

更多的使用可以参考阿里云表格储存 Tablestore 官方文档 原文。

coa-ali-ots's People

Contributors

adaex avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.