darkdarcool (142)

Hi there!

I have been making a module for a while where it worked, and it was nice.

But since it's similar to jest, I want one more thing to be like it

When you run npx jest in the terminal, it gives you all your test, but I want mine to be:

npx chitchatjs myfile

So you don't have to require it

I got the executable part down, but I have no idea how to make it so chitchat can find a file, and make it so you don't have require it.

Can someone fork my project and show me how to do it? It would be great!

You are viewing a single comment. View All
Answered by Coder100 (18913) [earned 5 cycles]
View Answer
Coder100 (18913)

wait a second
how about something like this:

let file = fs.readFileSync(...);
file = `const test = require("chitchatjs");\n` + file

right, that's what you want?