Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 10 and before - how to require/import? #9

Open
diablodale opened this issue Jul 14, 2019 · 1 comment
Open

Node 10 and before - how to require/import? #9

diablodale opened this issue Jul 14, 2019 · 1 comment

Comments

@diablodale
Copy link

Hello. I'm on Node 10.x on AWS lambda. How can Node versions 10 or less best utilize this package? The following seems to work for me, though it is an unusual method.

Worked

const { default: inMemoryCache } = require('@nrk/nodecache-as-promised');
const ciCache2 = inMemoryCache();

Failed

SyntaxError: Unexpected identifier

import inMemoryCache from '@nrk/nodecache-as-promised';
const cache = inMemoryCache();

inMemoryCache is not a function

const inMemoryCache = require('@nrk/nodecache-as-promised');
const ciCache2 = inMemoryCache();

lacks a call or construct signature

const NCAP= require('@nrk/nodecache-as-promised');
const myCache = new NCAP();
@agrohs
Copy link

agrohs commented Nov 17, 2019

The code below is working fine for us:

import inMemoryCache from '@nrk/nodecache-as-promised'
const cache = inMemoryCache()

When you mention SyntaxError: Unexpected identifier, what unexpected identifier is it telling you it doesn't like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants