JoshMerlino / namemc

The unofficial Node JS API for looking up Minecraft users on Name MC
https://www.npmjs.com/package/namemc
MIT License
13 stars 5 forks source link

"Require" #3

Closed AndyReckt closed 3 years ago

AndyReckt commented 3 years ago

hi, in ur readme you say we can also import using the "require" function, i would like to know whats the command line, since the "import" one doesnt work for me

Varmolord commented 3 years ago

Same for me.. const lookupName = require('namemc') does not work.

JoshMerlino commented 3 years ago

The package returns an object with the functions your looking for. You can use the destructure syntax to destructure the methods you need.

For example:

const { lookupName } = require("namemc");
// Or
const lookupName = require("namemc").lookupName;

The same will work with the other functions in the package