sindresorhus/cows

Can not use in browser side.

KaiOrange opened this issue · 2 comments

TypeError: fs.readFileSync is not a function
Can not use in browser side.

The module is for Node.js, not the browser.

I wrote a node script. It help me to convert the TXT file into a json file.

const cows = require("cows");
const fs = require("fs");
const path = require("path");
const cowsArray = cows();
fs.writeFileSync(path.join(__dirname, 'cows.json'), JSON.stringify(cowsArray),'utf8');

So I can import the file this way

const cowsArray = require("./cows.json");