├── .gitignore ├── .travis.yml ├── example └── simple.js ├── .jshintrc ├── .editorconfig ├── lib └── bower-list.js ├── .jscs.json ├── package.json ├── README.md └── gulpfile.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | temp/ 3 | coverage/ 4 | npm-debug.log 5 | .DS_Store 6 | .idea 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.10' 4 | after_script: 5 | - npm run coveralls 6 | -------------------------------------------------------------------------------- /example/simple.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bower-list 3 | * https://github.com/stefanbuck/bower-list 4 | * 5 | * Copyright (c) 2014 Stefan Buck 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | 'use strict'; 10 | 11 | var bowerList = require('../'); 12 | 13 | var options = { 14 | filter: ['name', 'website'] 15 | }; 16 | 17 | bowerList(options, function(err, data) { 18 | if (err) { 19 | throw err; 20 | } 21 | 22 | console.log(data); 23 | }); 24 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "unused": true, 11 | "boss": true, 12 | "eqnull": true, 13 | "node": true, 14 | "globals": { 15 | "describe" : false, 16 | "it" : false, 17 | "before" : false, 18 | "beforeEach" : false, 19 | "after" : false, 20 | "afterEach" : false 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # Change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # We recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | -------------------------------------------------------------------------------- /lib/bower-list.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bower-list 3 | * https://github.com/stefanbuck/bower-list 4 | * 5 | * Copyright (c) 2014 Stefan Buck 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | 'use strict'; 10 | 11 | var jsonRequester = require('json-requester'); 12 | var REGISTRY_URL = 'https://bower-component-list.herokuapp.com'; 13 | 14 | module.exports = function(options, cb) { 15 | if (typeof options === 'function') { 16 | cb = options; 17 | options = {}; 18 | } 19 | 20 | options = options || {}; 21 | options.uri = options.uri || REGISTRY_URL; 22 | 23 | jsonRequester(options, function(err, data) { 24 | if (err) { 25 | return cb(err); 26 | } 27 | cb(null, data); 28 | }); 29 | }; 30 | -------------------------------------------------------------------------------- /.jscs.json: -------------------------------------------------------------------------------- 1 | { 2 | "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], 3 | "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], 4 | "disallowSpaceBeforeBinaryOperators": [",", ":"], 5 | "disallowSpaceAfterBinaryOperators": ["!"], 6 | "requireSpaceBeforeBinaryOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 7 | "requireSpaceAfterBinaryOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 8 | "disallowImplicitTypeConversion": ["string"], 9 | "disallowKeywords": ["with"], 10 | "disallowMultipleLineBreaks": true, 11 | "disallowKeywordsOnNewLine": ["else"], 12 | "disallowTrailingWhitespace": true, 13 | "requireLineFeedAtFileEnd": true, 14 | "validateJSDoc": { 15 | "checkParamNames": true, 16 | "requireParamTypes": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bower-list", 3 | "description": "Requests a list of bower packages", 4 | "version": "0.1.3", 5 | "homepage": "https://github.com/stefanbuck/bower-list", 6 | "bugs": "https://github.com/stefanbuck/bower-list/issues", 7 | "license": "MIT", 8 | "main": "lib/bower-list.js", 9 | "author": { 10 | "name": "Stefan Buck", 11 | "email": "dev@stefanbuck.com", 12 | "url": "http://stefanbuck.com" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/stefanbuck/bower-list" 17 | }, 18 | "keywords": [], 19 | "dependencies": { 20 | "json-requester": "^0.2.0" 21 | }, 22 | "devDependencies": { 23 | "coveralls": "^2.10.0", 24 | "gulp": "^3.6.2", 25 | "gulp-bump": "^0.1.8", 26 | "gulp-istanbul": "^0.2.0", 27 | "gulp-jscs": "^0.4.2", 28 | "gulp-jshint": "^1.5.5", 29 | "gulp-load-plugins": "^0.5.1", 30 | "gulp-mocha": "^0.4.1", 31 | "gulp-plumber": "^0.6.2", 32 | "gulp-util": "2.2.16", 33 | "jshint-stylish": "^0.2.0" 34 | }, 35 | "scripts": { 36 | "coveralls": "gulp test && cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", 37 | "test": "gulp test" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bower-list 2 | [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-url]][daviddm-image] 3 | 4 | > Requests a list of bower packages with [json-requester](https://github.com/stefanbuck/json-requester) 5 | 6 | 7 | ## Install 8 | 9 | ```bash 10 | $ npm install --save bower-list 11 | ``` 12 | 13 | 14 | ## Usage 15 | 16 | ```javascript 17 | var bowerList = require('bower-list'); 18 | 19 | var options = { 20 | filter: ['name', 'website'] 21 | }; 22 | bowerList(options, function(err, data) { 23 | if (err) { 24 | throw err; 25 | } 26 | 27 | console.log(data); 28 | // => [ { name: '10digit-validation', website: 'https://github.com/10digit/validation' }, 29 | // { name: '1140px-responsive-css-grid', website: 'https://github.com/aosmialowski/1140px-Responsive-CSS-Grid' }, 30 | // { name: '15puzzle', website: 'https://github.com/rupertqin/15puzzle' } 31 | // ] 32 | }); 33 | 34 | ``` 35 | 36 | ## License 37 | 38 | Copyright (c) 2014 Stefan Buck. Licensed under the MIT license. 39 | 40 | 41 | 42 | [npm-url]: https://npmjs.org/package/bower-list 43 | [npm-image]: https://badge.fury.io/js/bower-list.svg 44 | [daviddm-url]: https://david-dm.org/stefanbuck/bower-list.svg?theme=shields.io 45 | [daviddm-image]: https://david-dm.org/stefanbuck/bower-list 46 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var plugins = require('gulp-load-plugins')(); 5 | 6 | var paths = { 7 | lint: ['./gulpfile.js', './lib/**/*.js'], 8 | watch: ['./gulpfile.js', './lib/**', './test/**/*.js', '!test/{temp,temp/**}'], 9 | tests: ['./test/**/*.js', '!test/{temp,temp/**}'], 10 | source: ['./lib/*.js'] 11 | }; 12 | 13 | gulp.task('lint', function () { 14 | return gulp.src(paths.lint) 15 | .pipe(plugins.jshint('.jshintrc')) 16 | .pipe(plugins.plumber()) 17 | .pipe(plugins.jscs()) 18 | .pipe(plugins.jshint.reporter('jshint-stylish')); 19 | }); 20 | 21 | gulp.task('istanbul', function (cb) { 22 | gulp.src(paths.source) 23 | .pipe(plugins.istanbul()) // Covering files 24 | .on('finish', function () { 25 | gulp.src(paths.tests) 26 | .pipe(plugins.plumber()) 27 | .pipe(plugins.mocha()) 28 | .pipe(plugins.istanbul.writeReports()) // Creating the reports after tests runned 29 | .on('finish', function() { 30 | process.chdir(__dirname); 31 | cb(); 32 | }); 33 | }); 34 | }); 35 | 36 | gulp.task('bump', ['test'], function () { 37 | var bumpType = plugins.util.env.type || 'patch'; // major.minor.patch 38 | 39 | return gulp.src(['./package.json']) 40 | .pipe(plugins.bump({ type: bumpType })) 41 | .pipe(gulp.dest('./')); 42 | }); 43 | 44 | gulp.task('watch', ['test'], function () { 45 | gulp.watch(paths.watch, ['test']); 46 | }); 47 | 48 | gulp.task('test', ['lint', 'istanbul']); 49 | 50 | gulp.task('release', ['bump']); 51 | 52 | gulp.task('default', ['test']); 53 | --------------------------------------------------------------------------------