i am going to make a npm package that can check the main file if it's exist how can i detect the file path?
main file
index.js
const exampleCheck = require("exampleCheck")
exampleCheck(__dirname);
node_modules
const path = require("path");
const fs = require("fs-extra");
module.exports = async function(file) {
if (!fs.existsSync(path.join(file, "index.js"))) return console.log("index.js doesn't exist");
}
my question is why the fs.existSync on my package at node_modules always return false but the index.js is exist at the main file
i hope you understand my english haha please help me a lot
my package always says index doesn't exist but it's exist at the main file
finding the file path