Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaticaq committed Mar 20, 2016
0 parents commit bd42742
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
lib
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v5
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
src
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v5
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2016 Leonardo Gatica

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.

21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# anime-dl-cli

[![npm version](https://img.shields.io/npm/v/anime-dl-cli.svg?style=flat-square)](https://www.npmjs.com/package/anime-dl-cli)
[![npm downloads](https://img.shields.io/npm/dm/anime-dl-cli.svg?style=flat-square)](https://www.npmjs.com/package/anime-dl-cli)
[![dependency Status](https://img.shields.io/david/lgaticaq/anime-dl-cli.svg?style=flat-square)](https://david-dm.org/lgaticaq/anime-dl-cli#info=dependencies)
[![devDependency Status](https://img.shields.io/david/dev/lgaticaq/anime-dl-cli.svg?style=flat-square)](https://david-dm.org/lgaticaq/anime-dl-cli#info=devDependencies)
[![Join the chat at https://gitter.im/lgaticaq/anime-dl-cli](https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg?style=flat-square)](https://gitter.im/lgaticaq/anime-dl-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

CLI for show and download anime from jkanime.net

## Installation

```bash
npm i -g anime-dl-cli
```

## Use

```bash
anime-dl -a <anime> -c <chapter>
```
79 changes: 79 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "anime-dl-cli",
"version": "1.0.0",
"description": "CLI for show and download anime from jkanime.net",
"main": "lib",
"scripts": {
"prepublish": "npm run build -s",
"prebuild": "npm run lint -s && npm run clean -s",
"build": "babel src --out-dir lib --source-maps",
"lint": "eslint src && eslint test",
"clean": "rimraf lib"
},
"engines": {
"node": ">=0.12"
},
"bin": {
"anime-dl": "lib/index.js"
},
"preferGlobal": true,
"repository": {
"type": "git",
"url": "https://github.com/lgaticaq/anime-dl-cli.git"
},
"keywords": [
"anime",
"cli"
],
"author": "Leonardo Gatica <[email protected]> (https://about.me/lgatica)",
"license": "MIT",
"bugs": {
"url": "https://github.com/lgaticaq/anime-dl-cli/issues"
},
"homepage": "https://github.com/lgaticaq/anime-dl-cli#readme",
"dependencies": {
"anime-dl": "^2.0.1",
"commander": "^2.9.0"
},
"devDependencies": {
"babel-cli": "^6.6.5",
"babel-core": "^6.7.2",
"babel-preset-es2015": "^6.6.0",
"eslint": "^2.4.0",
"rimraf": "^2.5.2"
},
"eslintConfig": {
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
2,
2
],
"linebreak-style": [
2,
"unix"
],
"quotes": [
2,
"single"
],
"semi": [
2,
"always"
]
}
},
"babel": {
"presets": [
"es2015"
]
}
}
24 changes: 24 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node

'use strict';

import program from 'commander';
import animeDl from 'anime-dl';
import pkg from '../package.json';

program
.version(pkg.version)
.usage('-a <anime> -c <chapter>')
.description('CLI for get chapter link')
.option('-a, --anime [anime]', 'Add name')
.option('-c, --chapter [chapter]', 'Add chapter')
.parse(process.argv);

if (program.anime && program.chapter) {
animeDl.getLinksByNameAndChapter(program.anime, program.chapter).then((data) => {
if (data.urls.length === 0) return console.log('Not found a link');
console.log(data.urls[data.urls.length - 1]);
}).catch(() => console.log('an error occurred'));
} else {
program.help();
}

0 comments on commit bd42742

Please sign in to comment.