Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from sergejmueller/1.0.0
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
sergejmueller committed Oct 27, 2016
2 parents b6cbe39 + 516fff0 commit 8d1b91a
Show file tree
Hide file tree
Showing 10 changed files with 1,012 additions and 45 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plugins": ["node"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"env": {
"mocha": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"no-console": 0
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ node_modules
.npm
logs
*.log
*.lock
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ node_js:
- "4"
- "0.12"
- "0.11"
- "0.10"
- "0.10"
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# ltrim / CHANGELOG


### v1.0.0 (2016-10-27)

* Add ESLint with `node` plugin
* Remove `*.lock` from `.gitignore`
* Refactor `package.json`
* Text changes in `README.md`
* Add `yarn.lock` file
* Some code cleanups


### v0.0.3 (2016-06-17)

* Cleanup readme
Expand All @@ -11,4 +24,4 @@

### v0.0.1 (2016-06-16)

* Initial commit

* Initial commit

19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ltrim
============

`ltrim` [Node.js module](https://www.npmjs.com/package/ltrim) returns a string with whitespace (or other characters) stripped from the beginning of a string. Without dependencies and library bloat.
`ltrim` Node.js module returns a string with whitespace (or other characters) stripped from the beginning of a string. Without dependencies and library bloat.


[![Dependency Status](https://david-dm.org/sergejmueller/ltrim.svg)](https://david-dm.org/sergejmueller/ltrim)
Expand All @@ -13,10 +13,16 @@ ltrim
Install
-----

```
```bash
npm install ltrim
```

*or*

```bash
yarn add ltrim
```


Usage
-----
Expand All @@ -25,8 +31,10 @@ Usage
ltrim ( str [, chars ] )
```

`str` → The input string<br>
`chars` → Characters that you want to be stripped
Parameter | Description
--- | ---
`str` | The input string
`chars` | Characters that you want to be stripped

Without the second parameter, `ltrim` will strip whitespaces (spaces, tabs and new lines).

Expand All @@ -35,8 +43,7 @@ Examples
-----

```javascript
var ltrim = require('ltrim');

var ltrim = require( 'ltrim' );

/* Strip whitespace from the beginning of a string */
ltrim( ' Hello ' ) + ' World' // →Hello World
Expand Down
2 changes: 1 addition & 1 deletion examples/ltrim.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";


var ltrim = require('..');
var ltrim = require( '..' );


/**
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function ( str, chars ) {

// Set vars
var i = 0,
letters = str.split(''),
letters = str.split( '' ),
count = letters.length;

// Loop letters
Expand Down
64 changes: 35 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
{
"name": "ltrim",
"version": "0.0.3",
"description": "Strip whitespace - or other characters - from the beginning of a string",
"main": "index.js",
"scripts": {
"test": "mocha"
},
"keywords": [
"trim",
"ltrim",
"strip",
"string"
],
"author": {
"name": "Sergej Müller",
"url": "https://sergejmueller.github.io"
},
"homepage": "https://github.com/sergejmueller/ltrim",
"repository": {
"type": "git",
"url": "https://github.com/sergejmueller/ltrim.git"
},
"license": "MIT",
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.1.2",
"array-range": "^1.0.1",
"shuffle-array": "^1.0.0"
}
"name": "ltrim",
"version": "1.0.0",
"description": "Strip whitespace - or other characters - from the beginning of a string",
"main": "index.js",
"files": [
"index.js"
],
"scripts": {
"test": "mocha",
"lint": "eslint ."
},
"keywords": [
"trim",
"ltrim",
"strip",
"string"
],
"author": {
"name": "Sergej Müller",
"url": "https://sergejmueller.github.io"
},
"homepage": "https://github.com/sergejmueller/ltrim",
"repository": "sergejmueller/ltrim",
"license": "MIT",
"devDependencies": {
"array-range": "^1.0.1",
"chai": "^3.5.0",
"eslint": "^3.8.1",
"eslint-plugin-node": "^2.1.3",
"mocha": "^3.1.2",
"shuffle-array": "^1.0.0"
},
"engines": {
"node": ">=0.10"
}
}
10 changes: 5 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";


var ltrim = require('..'),
range = require('array-range'),
shuffle = require('shuffle-array'),
expect = require('chai').expect;
var ltrim = require( '..' ),
range = require( 'array-range' ),
shuffle = require( 'shuffle-array' ),
expect = require( 'chai' ).expect;


describe( 'Strip characters from the beginning of a string', function() {
Expand Down Expand Up @@ -67,6 +67,6 @@ var shuffledSpecialChars = function() {
chars.push( String.fromCharCode( _ ) );
} );

return shuffle( chars ).join('');
return shuffle( chars ).join( '' );

}

0 comments on commit 8d1b91a

Please sign in to comment.