Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it NPM/Browserify Compatible #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is currently available for publish on the npm registry. This will only work once published there. Let me know if you want me to get it up there for you.

```

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