Sign in to follow this  
Urukhay

How can i use "require" from the command?

Recommended Posts

Urukhay    0

Command like the:

modules.exports = {
	"cmdt": (player) => {
		var f = require("../mysqlSaver");
		f.mysqlSave(player);
	}
}

"mysqlSave" function is not called.

Edited by Urukhay

Share this post


Link to post
Share on other sites
Captien    19

can you specify if mysqlSaver is a Npm or a File?

If a file do  var f = require("./mqsqlSaver.js");

If a npm just do var f = require("mysqlSave");

  • Like 1

Share this post


Link to post
Share on other sites
Urukhay    0

But why the node.js service had called variant above?

 

I use the require (with .js) in the index.js and it not works. It's as if requires are not supported.

Edited by Urukhay

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.