Let’s use this repository as our test / learning repository to work with Node and to implement the functionality that we want to add to our Hoodie Desktop App.
For the first iteration, I’d like to be able to do this
git clone https://github.com/Rookies-RGSOC2016/create-hoodie-app-cli.git
cd create-hoodie-app-cli
npm install
npm start
The npm start command will create a folder path/ in the current path and a path/package.json file that looks like the one mentioned in Hoodie’s setup instructions
Here are some hints that will help, but please feel free to try to figure it out by yourself :)
- create a
package.json file with npm init
- create an
index.js file, it’s the entry file of your application. Add a console.log("hello world"), try to run it with node index.js
- in the
package.json file, add "main": "index.js",
- in the
package.json file, add "scripts": {"start": "node index.js"},
- now run
npm start, this will execute the code in index.js now
- to create a folder, use the mkdirp package
- to create a file, use the built-in fs module. The
fs.writeFile is probably the method you want to create the package.json file
Good luck @titay2 @flyjwayur and welcome to Node.js \o/ Let me know if you have any questions :)
Let’s use this repository as our test / learning repository to work with Node and to implement the functionality that we want to add to our Hoodie Desktop App.
For the first iteration, I’d like to be able to do this
The
npm startcommand will create a folderpath/in the current path and apath/package.jsonfile that looks like the one mentioned in Hoodie’s setup instructionsHere are some hints that will help, but please feel free to try to figure it out by yourself :)
package.jsonfile withnpm initindex.jsfile, it’s the entry file of your application. Add aconsole.log("hello world"), try to run it withnode index.jspackage.jsonfile, add"main": "index.js",package.jsonfile, add"scripts": {"start": "node index.js"},npm start, this will execute the code inindex.jsnowfs.writeFileis probably the method you want to create the package.json fileGood luck @titay2 @flyjwayur and welcome to Node.js \o/ Let me know if you have any questions :)