SSH2 client and server modules written in pure JavaScript for node.js.
- Requirements
- Installation
- Create New Angela.js Project
- Run project
- Generate command
- Destroy command
- Help
- Common Mistakes
- Licence Information
- node.js -- v5.2.0 or newer
If you're installing Angela.js from NPM, you just have to run the following command:
> npm install angela-js -g
If you're installing Angela.js from Github Repo, you just have to run the following commands:
> git clone https://github.com/jmfranci/angela-js.git
> cd angela-js
> npm install
> npm link
To ensure that Angela.js is correctly installed in your machine, execute the following command to check your Angela.js version
> angela --version
To create a new Angela.js project, run the following command:
> angela init <ProjectName>
If the project name is not provided, Angela will prompt the user to enter a project name.
After the project is created, the following folder three is available
<ProjectName>
├── config
├── controllers
├── middleware
├── models
├── node_modules
├── routes
| └── home.js
├── startup
| └── routes.js
├── .gitignore
├── index.js
├── package.json
├── package-lock.json
├── startup
└── README.md
To run your Angela.js project, execute the following command:
> cd <ProjectName> #If you're not in the project directory
> angela run
This should open a connection to the http://localhost:3000.
The generate command is responsible for generating any type of file to an Angela.js project. The generate command can be used with either angela g
or angela generate
.
To generate a model, you write the following:
> angela g model <ModelName>
If model name is not provided, angela will prompt user to enter model name.
> angela g model user
The file is created at ProjectName/models/user.js
//Customize this model
const mongoose = require('mongoose');
const Joi = require('joi');
const userSchema = new mongoose.Schema({
});
const user = mongoose.model('user', genreSchema);
function validateuser(user) {
const schema = {
};
return Joi.validate(user, schema);
}
module.exports.validateuser = validateuser;
module.exports.user = user;
module.exports.userSchema = userSchema;
You can also add properties to your model right from the command line. To do so, you need the following command:
angela g model user -p name.str.req