Skip to content

Commit

Permalink
Merge pull request #6 from therebelrobot/feature/3-npm-compatible
Browse files Browse the repository at this point in the history
Make it NPM/Browserify Compatible
  • Loading branch information
marcojetson committed Sep 1, 2015
2 parents 738c561 + 74f3221 commit 3b16f8e
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
type-ahead.js
=============
# type-ahead.js

A lightweight and extensible type ahead library
A lightweight and extensible type ahead library. Browserify compatible.

Demo
----
## Demo

Check out http://marcojetson.github.io/type-ahead.js/

Usage
-----
## Install
### Browserify via NPM

To use type-ahead with Browserify, install it into your project via npm:

```bash
npm install type-ahead
```

Once installed, include the library using `require`:

```javascript
var TypeAhead = require('type-ahead')
```

### Manually

You can also include the standalone library by downloading it [here](https://raw.githubusercontent.com/marcojetson/type-ahead.js/master/type-ahead.js) (or [minified](https://raw.githubusercontent.com/marcojetson/type-ahead.js/master/type-ahead.min.js)), and including it in your HTML page:

```html
<script type="text/javascript" src="type-ahead.js"></script>
```

## Usage

### Simple usage

Expand All @@ -32,7 +52,7 @@ t.getCandidates = function (callback) {
};
```

_Example is using jQuery for simplicity_
*Example is using jQuery for simplicity*


### Min length and limit
Expand Down Expand Up @@ -62,3 +82,8 @@ t.getItemValue = function (item) {
return item.name;
};
```
## Contributing

Found an issue? Have a feature request? Open a [Github Issue]() and/or [fork this repo]().

## License
54 changes: 54 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "type-ahead",
"version": "1.0.0",
"description": "A lightweight and extensible type ahead library",
"main": "src/type-ahead.js",
"scripts": {
"build":"browserify src/type-ahead.js -s TypeAhead -o type-ahead.js && uglifyjs type-ahead.js -o type-ahead.min.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/marcojetson/type-ahead.js.git"
},
"keywords": [
"typeahead",
"type",
"ahead",
"type-ahead",
"a",
"head",
"auto",
"complete",
"autocomplete",
"typ",
"typing",
"completing",
"micro",
"microjs",
"marcojetson",
"marco",
"jetson",
"lightweight",
"extensible",
"objects",
"strings",
"list",
"collections",
"mithril",
"mithriljs",
"compatible"
],
"author": "Marco (@marcojetson)",
"contributors": [
"Trent Oswald <[email protected]> [@therebelrobot] (http://therebelrobot.com)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/marcojetson/type-ahead.js/issues"
},
"homepage": "https://github.com/marcojetson/type-ahead.js#readme",
"devDependencies": {
"browserify": "^11.0.1",
"uglify-js": "^2.4.24"
}
}
Loading

0 comments on commit 3b16f8e

Please sign in to comment.