| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Shows the world the steps to go to get proud to have your own npm install nodedemoapp
Create a new project on https://github.com/new
Clone your new repository by downloading/unzip or git clone https://github.com/yourGithubUserName/repositoryName.git
Create a NPM Account either by npm adduser or at https://npmjs.org/signup
login by npm login
Within your local repository: create a package.json (you can use the npm init command what walks you through)
Create a server.js including the planed module
exports.hello = function(who){
console.log('Hello '+who);
};
commit it to your repository by git add *, git commit -m "your comment" and git push origin master
where your package.json is located execute npm publish
If you see +nodedemoapp you have done well :-)
If you see e.g. + nodedemoapp@1.0.1 you have done well :-)
To use your first own node module you simple create a test.js
var demo = require('nodedemoapp');
demo.hello('GitHub');
Don't forget to install the module before executing node test.js
npm install nodedemoapp
Or you could add a dependancy to your package.json
"dependencies": {
"nodedemoapp": "0.0.3"
}
and install your app by npm install within your directory
To test whether the module works itself you can download the archive, extract the zip and execute the following with the created folder:
npm test
Because of the scripts part within package.json the bash script test will be executed
"scripts": {
"test": "for f in tests/*; do echo \"$f\"; node \"$f\"; done; echo 'Test state is OK'; exit 0"
},
In our example test case it executes code of tests/requireModueTest.js
var mod = require('../server.js');
try {
mod.hello('Testing User - Method exists (Test successful)');
}
catch (err){
console.log('something doesn\'t work well (Test failed)');
}
It is recommended to show badges and graphs about activities and state of the progress behind the module or library. If you like to have badges and shields in the same fitting size you can go to http://shields.io/ or use their new tool.
A collection of badges you can find here.
Professionals are working with (agile) project management frameworks. So you also could use scrum directly within your GitHub by Waffle.io and show an issue based chart.
Note: It would be a good idea to add an extra repository for things are not issues maybe
Badges like
came from Waffle.io same as project metrics based on issue labels (what can be added by your individual needs):
| Back | FazBrowse Home | New Git URL |