@ant-basement/function-sdk
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

function-js-sdk

Latest Stable Version License NPM Downloads

Basement SDK for Function service

Getting Started

tnpm install --save @ant-basement/function-sdk

Usage

// app.js
const urllib = require('urllib');
const Basement = require('@ant-basement/function-sdk');
app.basement = new Basement({
  spaceId: '148086d2-6881-434d-849b-e22bc687a0c2',
  endpoint: '47.100.226.126',
  serverSecret: 'KZMLzTM1q1WyOWVX+nlscgbhgL7B1RQFxrMolIY1U6Yq5rS79aNyDEnAUIhI/v8Q',
  logger: app.loggers.coreLogger.info,
  httpclient: urllib,
});

// controller/home.js
exports.index = async () => {
  const collectionNames = await app.basement.db.collections();
  const newFile = await app.basement.file.uploadFile();
  const newFileWithUser = await app.basement.setUserId('user_id1234').file.uploadFile();
};

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @ant-basement/function-sdk

    Weekly Downloads

    2

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    7.21 kB

    Total Files

    7

    Last publish

    Collaborators

    • fegg
    • sanglv
    • shouna.ysn
    • zack-lin