Skip to content

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

@diablodale

Description

@diablodale

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions