yandex-dialogs-sdk-lowdb
[![npm version](https://badge.fury.io/js/yandex-dialogs-sdk-lowdb.svg)](https://badge.fury.io/js/yandex-dialogs-sdk-lowdb)
Last updated a year ago by fletcherist .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install yandex-dialogs-sdk-lowdb 
SYNC missed versions from official npm registry.

yandex-dialogs-sdk-lowdb

npm version

Makes your session persistent by saving it into a json file. This middleware uses lowdb database

Middleware for yandex-dialogs-sdk

Installation

npm i yandex-dialogs-sdk-lowdb --save
yarn add yandex-dialogs-sdk-lowdb

Usage

const { Alice } = require('yandex-dialogs-sdk');
const lowDBSession = require('yandex-dialogs-sdk-lowdb');

const alice = new Alice();
// Now user session becomes persistent
// Sync with file databse.json
alice.use(lowDBSession.middleware('database.json'));

alice.any(ctx => {
    const counter = ctx.session.get('counter') || 0;
    ctx.session.set('counter', counter + 1);
    return Reply.text(`count: ${counter + 1}`);
});
alice.listen(8080);

Current Tags

  • 1.1.1                                ...           latest (a year ago)

5 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (3)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |