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

How to use this npm? #2

Closed
mingkunm opened this issue Mar 9, 2020 · 2 comments
Closed

How to use this npm? #2

mingkunm opened this issue Mar 9, 2020 · 2 comments

Comments

@mingkunm
Copy link

mingkunm commented Mar 9, 2020

Hi,

When I use:
const verifier = require('academic-email-verifier');
let isAcademic = await verifier.isAcademic(email);

terminal will raise these error:
UnhandledPromiseRejectionWarning: TypeError: verifier.isAcademic is not a function

It means isAcademic is not a function, and when I use:
import { Verifier } from 'academic-email-verifier';

the error will be:
import { Verifier } from 'academic-email-verifier';
^^^^^^

SyntaxError: Cannot use import statement outside a module

How can I solve it?

Thank you!

@vwinstea
Copy link

vwinstea commented Feb 1, 2021

After messing around with this package it turns out the correct way to import this is
const verifier = require('academic-email-verifier').Verifier
I have no idea why this works, but this should fix any import errors you are having

@bennymeg
Copy link
Owner

As stated by documentation you import the verifier as such:
import { Verifier } from 'academic-email-verifier';

If you wish to require it, you can use the following statement:
const verifier = require('academic-email-verifier').Verifier

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

3 participants