Skip to content

Commit 6fa71ab

Browse files
committed
Initial commit
0 parents  commit 6fa71ab

9 files changed

+134
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[{package.json,*.yml}]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- '5'
4+
- '4'
5+
- '0.12'
6+
- '0.10'

index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
module.exports = function (str, opts) {
3+
if (typeof str !== 'string') {
4+
throw new TypeError('Expected a string');
5+
}
6+
7+
opts = opts || {};
8+
9+
return str + ' & ' + (opts.postfix || 'rainbows');
10+
};

license

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Ian Sinnott <[email protected]> (github.com/iansinnott)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "react-string-replace",
3+
"version": "0.0.0",
4+
"description": "My amazing module",
5+
"license": "MIT",
6+
"repository": "iansinnott/react-string-replace",
7+
"author": {
8+
"name": "Ian Sinnott",
9+
"email": "[email protected]",
10+
"url": "github.com/iansinnott"
11+
},
12+
"engines": {
13+
"node": ">=0.10.0"
14+
},
15+
"scripts": {
16+
"test": "xo && ava"
17+
},
18+
"files": [
19+
"index.js"
20+
],
21+
"keywords": [
22+
""
23+
],
24+
"dependencies": {},
25+
"devDependencies": {
26+
"ava": "^0.8.0",
27+
"xo": "^0.12.1"
28+
}
29+
}

readme.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# react-string-replace [![Build Status](https://travis-ci.org/iansinnott/react-string-replace.svg?branch=master)](https://travis-ci.org/iansinnott/react-string-replace)
2+
3+
> My amazing module
4+
5+
6+
## Install
7+
8+
```
9+
$ npm install --save react-string-replace
10+
```
11+
12+
13+
## Usage
14+
15+
```js
16+
const reactStringReplace = require('react-string-replace');
17+
18+
reactStringReplace('unicorns');
19+
//=> 'unicorns & rainbows'
20+
```
21+
22+
23+
## API
24+
25+
### reactStringReplace(input, [options])
26+
27+
#### input
28+
29+
Type: `string`
30+
31+
Lorem ipsum.
32+
33+
#### options
34+
35+
##### foo
36+
37+
Type: `boolean`
38+
Default: `false`
39+
40+
Lorem ipsum.
41+
42+
43+
## License
44+
45+
MIT © [Ian Sinnott](https://github.com/iansinnott)

test.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import test from 'ava';
2+
import fn from './';
3+
4+
test('title', t => {
5+
t.is(fn('unicorns'), 'unicorns & rainbows');
6+
});

0 commit comments

Comments
 (0)