Call A Function Inside Of Other File

I’m Trying To Create A Npm Module That When You Call It, It’s Supposed To Execute The main()
Function In The index.js (file that calls the module) File.

But When I Try To Run It It Says :

Error: 
 ReferenceError: main is not defined

Here Is The Files

(module) index.js:

try {
    main()
} catch (error) { 
    console.log(`Error: n ${error}`) 
} 

(test file) test.js

var js = require("./index")

function main() {
    console.log("Better JS Working")

    return 0
}