W
W
Wasya UK2017-04-22 09:49:08
HTML
Wasya UK, 2017-04-22 09:49:08

How to attach JSON file to JADE/PUG?

How to attach a JSON file to JADE/PUG without using gulp and stuff? I am working with nodejs and want to store JSON with menu categories in public. Is it possible to somehow use this file through include-extend ... Or in another way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
de1m, 2017-04-22
@de1m

It is possible through Either stupid as a variable

fs.readFile('./file.json', function read(err, data) {
//...
});

You can also use readFileSync.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question