You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

center-align

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

center-align - npm Package Compare versions

Comparing version

to
0.1.2

utils.js

4

index.js

@@ -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 [![NPM version](https://badge.fury.io/js/center-align.svg)](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._