Could not find any documentation over setting up fp-ts on nodejs
SHND opened this issue · comments
I'm having a hard time setting up a testing and learning node, typescript project to play around with fp-ts.
Adding a documentation on how to start a project from bare metal on different environments are pretty appreciated.
I could transpile this using tsc
but I couldn't make it work with ts-node
or deno
.
For anyone else like me who want to create a project to try things really quick add this to your package.json
:
npm init -y
npm install fp-ts nodemon
mkdir ./src/index.ts
- Add below to package.json
"start": "nodemon -w ./src/index.ts -q -x 'clear; tsc --strict ./src/index.ts --outDir ./build && node ./build/index.js'",
- Start watching your
./src/index.ts
by running command below:
npm start
I met the some problem that fp-ts
doesn't work on Node.js ES Module due to it's package.json
declaration.
Have tried 3.0.0-alpha.26
and 2.13.1
.
Honestly I don't remember what was my initial issue and what I did to fix it, but something that I remember that was pretty helpful was the tsconfig.json in example directory in this repo. That file doesn't have anything special but it extends from the main repo tsconfig file. So if you have a hard time setting TypeScript for your project, use this tsconfig.json file here.
One of the configs that I remember was important is "strict": true
I'm closing this since I don't have this issue anymore.