@salutejs/storage-adapter-memory
Advanced tools
Weekly downloads
Readme
Адаптер для хранения сессии в памяти процесса.
npm i -S @salutejs/storage-adapter-memory
import { createSaluteRequest, createSaluteResponse, createScenarioWalker } from '@salutejs/scenario';
import { SaluteMemoryStorage } from '@salutejs/memory';
import express from 'express';
//...
const app = express();
app.use(express.json());
const storage = new SaluteMemoryStorage();
const scenarioWalker = createScenarioWalker({
intents,
recognizer,
systemScenario,
userScenario,
});
app.post('/', async ({ body }, response) => {
const req = createSaluteRequest(body);
const res = createSaluteResponse(body);
const session = await storage.resolve(body.uuid.sessionId);
await scenarioWalker({ req, res, session });
await storage.save({ id: body.uuid.sessionId, session });
response.status(200).json(res.message);
});
FAQs
In memory storage adapter for SaluteJS
The npm package @salutejs/storage-adapter-memory receives a total of 637 weekly downloads. As such, @salutejs/storage-adapter-memory popularity was classified as not popular.
We found that @salutejs/storage-adapter-memory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.