Skip to content

Commit baeb0da

Browse files
committed
Meteor integration
1 parent 26630d1 commit baeb0da

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

README.markdown

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Upgrading from 2.x to 3.x? Please read the [changelog][c].
1616

1717
[c]: https://github.com/epeli/underscore.string/blob/master/CHANGELOG.markdown#300
1818

19-
## Usage
19+
## Usage
2020

2121
### In Node.js and Browserify
2222

@@ -48,6 +48,26 @@ use.
4848

4949
[Browserify]: http://browserify.org/
5050

51+
### In Meteor
52+
53+
From your [Meteor][] project folder
54+
55+
```shell
56+
meteor add underscorestring:underscore.string
57+
```
58+
59+
and you'll be able to access the library with the ***s*** global from both the server and the client.
60+
61+
```javascript
62+
s.slugify("Hello world!");
63+
// => hello-world
64+
65+
s(" epeli ").trim().capitalize().value();
66+
// => "Epeli"
67+
```
68+
69+
[Meteor]: http://www.meteor.com/
70+
5171
### Others
5272

5373
The `dist/underscore.string.js` file is an [UMD][] build. You can load it using
@@ -64,7 +84,7 @@ It is still possible use as Underscore.js/Lo-Dash extension
6484
```javascript
6585
_.mixin(s.exports());
6686
```
67-
But it's not recommended since `include`, `contains`, `reverse` and `join`
87+
But it's not recommended since `include`, `contains`, `reverse` and `join`
6888
are dropped because they collide with the functions already defined by Underscore.js.
6989

7090
## Download

gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var gulp = require('gulp-param')(require('gulp'), process.argv),
1212
MIN_FILE = 'underscore.string.min.js',
1313
TEST_SUITES = ['test/test.html', 'test/test_standalone.html', 'test/test_underscore/index.html'],
1414
VERSION_FILES = ['./package.json', './component.json', './bower.json'];
15+
VERSION_FILES_JS = [SRC, 'package.js'];
1516

1617
gulp.task('test', ['browserify'], function() {
1718
return gulp.src(TEST_SUITES)
@@ -34,8 +35,8 @@ gulp.task('clean', function() {
3435
});
3536

3637
gulp.task('bump-in-js', function(semver) {
37-
return gulp.src(SRC)
38-
.pipe(replace(/(version\s?=?\s\')([\d\.]*)\'/gi, '$1' + semver + "'"))
38+
return gulp.src(VERSION_FILES_JS)
39+
.pipe(replace(/(version?\s?=?\:?\s\')([\d\.]*)\'/gi, '$1' + semver + "'"))
3940
.pipe(gulp.dest('./'));
4041
});
4142

package.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// package metadata file for Meteor.js
2+
3+
Package.describe({
4+
name: 'underscorestring:underscore.string',
5+
summary: 'underscore.string (official): String manipulation extensions for Underscore.js javascript library.',
6+
version: '3.0.3',
7+
git: 'https://github.com/epeli/underscore.string.git',
8+
documentation: 'README.markdown'
9+
});
10+
11+
Package.onUse(function (api) {
12+
api.versionsFrom('METEOR@1.0');
13+
api.addFiles('dist/underscore.string.js');
14+
});

0 commit comments

Comments
 (0)