├── .gitignore
├── LICENSE.md
├── README.md
├── example.png
├── gulpfile.babel.js
├── package.json
└── src
└── index.js
/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | .DS_Store
4 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | # The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Matheus Fernandes
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # parrotsay
2 |
3 |
4 |
5 |
6 | ## Install
7 |
8 | ```
9 | npm install --global parrotsay
10 | ```
11 |
12 | ## Usage
13 |
14 | `parrotsay yay`
15 |
16 | or
17 |
18 | `echo 'yay' | parrotsay`
19 |
20 | ## Related
21 |
22 | - [parrotsay-api](https://github.com/matheuss/parrotsay-api) - API for this module
23 | - [Cult of the Party Parrot](http://cultofthepartyparrot.com/)
24 |
25 | ## License
26 |
27 | MIT © [Matheus Fernandes](http://matheus.top)
28 |
--------------------------------------------------------------------------------
/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matheuss/parrotsay/01d7bf1f48cc55c428d373f986c48cd2e67c7096/example.png
--------------------------------------------------------------------------------
/gulpfile.babel.js:
--------------------------------------------------------------------------------
1 | import gulp from 'gulp'
2 | import babel from 'gulp-babel'
3 | import cache from 'gulp-cached'
4 | import chmod from 'gulp-chmod'
5 |
6 | gulp.task('transpile', () =>
7 | gulp.src('src/index.js')
8 | .pipe(cache('transpile'))
9 | .pipe(babel())
10 | .pipe(chmod(755))
11 | .pipe(gulp.dest('dist')))
12 |
13 | gulp.task('watch', () => gulp.watch('src/*.js', ['transpile']))
14 |
15 | gulp.task('default', ['watch', 'transpile'])
16 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "parrotsay",
3 | "version": "0.1.0",
4 | "description": "Say things with the Party Parrot on your terminal",
5 | "bin": {
6 | "parrotsay": "./dist/index.js"
7 | },
8 | "files": [
9 | "dist"
10 | ],
11 | "scripts": {
12 | "test": "xo"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "git+https://github.com/matheuss/parrotsay.git"
17 | },
18 | "keywords": [
19 | "parrotsay",
20 | "party",
21 | "parrot",
22 | "partyparrot",
23 | "party-parrot",
24 | "party_parrot",
25 | "cli",
26 | "terminal",
27 | "say"
28 | ],
29 | "author": "Matheus Fernandes (https://matheus.top/)",
30 | "license": "MIT",
31 | "bugs": {
32 | "url": "https://github.com/matheuss/parrotsay/issues"
33 | },
34 | "homepage": "https://github.com/matheuss/parrotsay#readme",
35 | "dependencies": {
36 | "get-stdin": "^5.0.1",
37 | "minimist": "^1.2.0",
38 | "parrotsay-api": "^0.1.1",
39 | "update-notifier": "^1.0.2"
40 | },
41 | "devDependencies": {
42 | "babel-plugin-add-module-exports": "^0.2.1",
43 | "babel-plugin-transform-es2015-modules-commonjs": "^6.14.0",
44 | "gulp": "^3.9.1",
45 | "gulp-babel": "^6.1.2",
46 | "gulp-cached": "^1.1.0",
47 | "gulp-chmod": "^1.3.0",
48 | "xo": "^0.16.0"
49 | },
50 | "babel": {
51 | "plugins": [
52 | "add-module-exports",
53 | "transform-es2015-modules-commonjs"
54 | ]
55 | },
56 | "xo": {
57 | "esnext": true,
58 | "space": true,
59 | "semicolon": false
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | import getStdin from 'get-stdin'
3 | import minimist from 'minimist'
4 | import parrot from 'parrotsay-api'
5 | import updateNotifier from 'update-notifier'
6 |
7 | const pkg = require('../package.json')
8 |
9 | updateNotifier({pkg}).notify()
10 |
11 | const input = minimist(process.argv.slice(2))._.join(' ')
12 |
13 | if (input) {
14 | parrot(input)
15 | .then(console.log)
16 | .catch(console.error)
17 | } else {
18 | getStdin().then(string => {
19 | parrot(string.trim() || 'LET\'S PARTY')
20 | .then(console.log)
21 | .catch(console.error)
22 | })
23 | }
24 |
--------------------------------------------------------------------------------