guyht / notp

Node One Time Password library, supports HOTP, TOTP and works with Google Authenticator
https://github.com/guyht/notp
MIT License
687 stars 66 forks source link

import notp returns undefined but require('notp') works #54

Open scazzy opened 4 years ago

scazzy commented 4 years ago

import notp from 'notp' seem to be returning undefined, but const notp = requires('notp') seem to return {hotp, totp} properly.

it's pretty weird but this does exist.

Node: 12.16.3 notp: ^2.0.3

krazibit commented 3 years ago
import notp from 'notp' 

above Imports default from the specified lib, as no default is defined in the lib, you'll have to use named import

import {hotp,notp} from 'notp'

or

import * as notp from 'notp'