coa-ali-ots
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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 官方文档 原文。

Package Sidebar

Install

npm i coa-ali-ots

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

7.9 kB

Total Files

15

Last publish

Collaborators

  • adaex