connect-dynamodb icon indicating copy to clipboard operation
connect-dynamodb copied to clipboard

ESM support

Open AJCWhite opened this issue 2 years ago • 2 comments

Hello,

Is it possible to use ES6 import like this (import DynamoDBStore from 'connect-dynamodb';) instead of require?

When I try the standard import I get errors relating to: TypeError: Cannot read properties of undefined (reading 'Store')

Thanks, Alex

AJCWhite avatar May 20 '22 15:05 AJCWhite

I would like to see this too

matthewdolman avatar Dec 05 '23 11:12 matthewdolman

Sorry if this is not what you want to do. My understanding is that the following is available in ES Module.

import express from 'express';
import session from 'express-session';
import connectDynamodb from 'connect-dynamodb';

const app = express();

const DynamoDBStore = connectDynamodb(session);
app.use(session({ store: new DynamoDBStore(options), secret: 'secret' }));

yutak23 avatar Dec 12 '23 00:12 yutak23