Skip to content
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
include:
- stage: test
script:
- npm run compile:prod
- npm run lint
- npm run test
- npm run compile:prod
- npm run is-es5
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
- stage: deploy
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Jae Bradley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# GitHub Languages Client

[![Build Status](https://travis-ci.org/jaebradley/github-languages-client.svg?branch=master)](https://travis-ci.org/jaebradley/github-languages-client)
[![npm](https://img.shields.io/npm/dt/express.svg)](github-https://www.npmjs.com/package/github-languages-client-client)
[![npm](https://img.shields.io/npm/v/npm.svg)](https://www.npmjs.com/package/github-languages-client)

[![npm](https://img.shields.io/npm/dt/github-languages-client.svg)](github-https://www.npmjs.com/package/github-languages-client-client)
[![npm](https://img.shields.io/npm/v/github-languages-client.svg)](https://www.npmjs.com/package/github-languages-client)

A `NodeJS` client to get languages GitHub knows about for [`Advanced Search`](https://github.com/search/advanced), for example.

Expand All @@ -13,7 +12,7 @@ A `NodeJS` client to get languages GitHub knows about for [`Advanced Search`](ht

`GitHub` maintains [a `linguist` repository](https://github.com/github/linguist) that contains [a `languages.yml` file](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml) that seems to represent the set of languages that `GitHub` knows about.

I have [a script](~/scripts/getLanguages.js) that makes a request to [the `raw.githubusercontent` API for this file](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml), converts the `YAML` to `JSON`, `camelCases` fields (and adds in some default values), and writes the output to [the `src/languages.json`](~/src/languages.json) file.
I have [a script](~/scripts/getLanguages.js) that makes a request to [the `raw.githubusercontent` API for this file](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml), converts the `YAML` to `JSON`, `camelCases` fields (and adds in some default values), and writes the output to [the `src/languages.json`](src/languages.json) file.

I then read from this file when instantiating the `GitHubLanguagesClient`.

Expand Down Expand Up @@ -42,7 +41,7 @@ The [`fuse.io` site](http://fusejs.io/) gives a good explanation of why and how

### `getAllLanguages`

This `static` method returns the complete array of all languages available, and the metadata associated with each language.
This `static` method returns the complete array of all languages available, and the metadata associated with each language. It essentially returns [the `src/languages.json`](src/languages.json) file as a `JavaScript` object.

```javascript
import GitHubLanguagesClient from 'github-languages-client';
Expand Down
Loading