Skip to content

Commit

Permalink
Docs & scripts
Browse files Browse the repository at this point in the history
- Created CONTRIBUTING.md
- Updated README.md
- Added package.json scripts
  • Loading branch information
kirill-konshin committed Mar 21, 2015
1 parent 6a60715 commit 508041b
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 14 deletions.
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contribution

# Git Flow

The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches.
Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch.

# Pull request

Target your pull request on `develop` branch. Other pull request won't be accepted.

# How to build

1. Clone

2. Run

```sh
npm install
```

3. Run

```sh
npm run build
```

4. Check `build` folder
57 changes: 43 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Modularized port of googlecode project crypto-js.
## Node.js (Install)

Requirements:
* Node.js
* npm (Node.js package manager)

- Node.js
- npm (Node.js package manager)

```bash
npm install crypto-js
Expand All @@ -15,6 +16,7 @@ npm install crypto-js
### Usage

Modular include:

```javascript
var AES = require("crypto-js/aes");
var SHA256 = require("crypto-js/sha256");
Expand All @@ -23,29 +25,67 @@ console.log(SHA256("Message"));
```

Including all libraries, for access to extra methods:

```javascript
var CryptoJS = require("crypto-js");
console.log(CryptoJS.HmacSHA1("Message", "Key"));
```

## Client (browser)

Requirements:

- Node.js
- Bower (package manager for frontend)

```bash
bower install crypto-js
```

### Usage

Modular include:

```javascript
require.config({
packages: [
{
name: 'crypto-js',
location: 'path-to/bower_components/crypto-js',
main: 'index'
}
]
});

require(["crypto-js/aes", "crypto-js/sha256"], function (AES, SHA256) {
console.log(SHA256("Message"));
});
```

Including all libraries, for access to extra methods:

```javascript
require("crypto-js", function (CryptoJS) {
// Above-mentioned will work or use this simple form
require.config({
paths: {
'require-js': 'path-to/bower_components/crypto-js/crypto-js'
}
});

require(["crypto-js"], function (CryptoJS) {
console.log(CryptoJS.HmacSHA1("Message", "Key"));
});
```

### Usage without RequireJS

```html
<script type="text/javascript" src="path-to/bower_components/crypto-js/crypto-js.js"></script>
<script type="text/javascript">
var encrypted = CryptoJS.AES(...);
var encrypted = CryptoJS.SHA256(...);
</script>

## API

See: https://code.google.com/p/crypto-js
Expand Down Expand Up @@ -122,17 +162,6 @@ See: https://code.google.com/p/crypto-js
- ```crypto-js/pad-zeropadding```
- ```crypto-js/pad-nopadding```

## Contribution

### Git Flow

The crypto-js project uses [git flow](https://github.com/nvie/gitflow) to manage branches.
Do your changes on the `develop` or even better on a `feature/*` branch. Don't do any changes on the `master` branch.

### Pull request

Target your pull request on `develop` branch. Other pull request won't be accepted.

## License

[The MIT License (MIT)](http://opensource.org/licenses/MIT)
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"url": "http://opensource.org/licenses/MIT"
}
],
"scripts": {
"build": "grunt build",
"check": "grunt default"
},
"main": "index.js",
"dependencies": {},
"devDependencies": {
Expand Down

0 comments on commit 508041b

Please sign in to comment.