center-align
Advanced tools
Comparing version
@@ -10,8 +10,8 @@ /*! | ||
var align = require('align-text'); | ||
var utils = require('./utils'); | ||
module.exports = function centerAlign(val) { | ||
return align(val, function (len, longest) { | ||
return utils.align(val, function (len, longest) { | ||
return Math.floor((longest - len) / 2); | ||
}); | ||
}; |
{ | ||
"name": "center-align", | ||
"description": "Center-align the text in a string.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jonschlinkert/center-align", | ||
"author": { | ||
"name": "Jon Schlinkert", | ||
"url": "https://github.com/jonschlinkert" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jonschlinkert/center-align.git" | ||
}, | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"repository": "jonschlinkert/center-align", | ||
"bugs": { | ||
"url": "https://github.com/jonschlinkert/center-align/issues" | ||
}, | ||
"license": { | ||
"type": "MIT", | ||
"url": "https://github.com/jonschlinkert/center-align/blob/master/LICENSE" | ||
}, | ||
"license": "MIT", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -32,7 +24,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"align-text": "^0.1.0" | ||
"align-text": "^0.1.0", | ||
"lazy-cache": "^0.2.4" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.0", | ||
"should": "*" | ||
"mocha": "^2.2.0" | ||
}, | ||
@@ -48,3 +40,14 @@ "keywords": [ | ||
"typography" | ||
] | ||
], | ||
"verb": { | ||
"related": { | ||
"description": "", | ||
"list": [ | ||
"align-text", | ||
"right-align", | ||
"justified", | ||
"word-wrap" | ||
] | ||
} | ||
} | ||
} |
# center-align [](http://badge.fury.io/js/center-align) | ||
> Right-align the text in a string. | ||
> Center-align the text in a string. | ||
## Install with [npm](npmjs.org) | ||
Install with [npm](https://www.npmjs.com/) | ||
```bash | ||
npm i center-align --save | ||
```sh | ||
$ npm i center-align --save | ||
``` | ||
@@ -42,18 +42,19 @@ | ||
## Related projects | ||
* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string. | ||
* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string. | ||
* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character | ||
* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length. | ||
* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text) | ||
* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified) | ||
* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align) | ||
* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap) | ||
## Running tests | ||
Install dev dependencies. | ||
```bash | ||
npm i -d && npm test | ||
Install dev dependencies: | ||
```sh | ||
$ npm i -d && npm test | ||
``` | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/center-align/issues) | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/center-align/issues/new). | ||
@@ -63,12 +64,13 @@ ## Author | ||
**Jon Schlinkert** | ||
+ [github/jonschlinkert](https://github.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
## License | ||
Copyright (c) 2015 Jon Schlinkert | ||
Released under the MIT license | ||
Copyright © 2015 Jon Schlinkert | ||
Released under the MIT license. | ||
*** | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 07, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 27, 2015._ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
5130
24.06%1
-50%5
25%43
230.77%74
1.37%2
100%2
Infinity%+ Added
+ Added