ca98am79 / connect-dynamodb

DynamoDB session store for Connect
http://ca98am79.github.com/connect-dynamodb/
MIT License
144 stars 66 forks source link

ESM support #73

Open AJCWhite opened 2 years ago

AJCWhite commented 2 years ago

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

matthewdolman commented 10 months ago

I would like to see this too

yutak23 commented 9 months ago

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' }));