voc-cli
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"name": "voc-cli", | ||
"version": "1.4.0", | ||
"description": "download and play English vocabularies' audio by command line", | ||
"main": "index.js", | ||
"os": [ | ||
"darwin", | ||
"linux" | ||
], | ||
"version": "1.5.0", | ||
"description": "download and play English vocabularies' audio via command line", | ||
"main": "src/getAudio.js", | ||
"engines": { | ||
@@ -16,3 +12,3 @@ "iojs": ">= 1.0.0", | ||
"bin": { | ||
"voc": "index.js" | ||
"voc": "voc.js" | ||
}, | ||
@@ -31,3 +27,5 @@ "scripts": { | ||
"webster", | ||
"ispeech" | ||
"collins", | ||
"ispeech", | ||
"voicerss" | ||
], | ||
@@ -34,0 +32,0 @@ "author": "zlargon", |
@@ -7,6 +7,7 @@ # voc | ||
The audio will be downloaded to directory `~/vocabulary` (this is configurable), and played by command line [`afplay`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/afplay.1.html) (this is configurable too) | ||
The audio will be downloaded to directory `~/vocabulary` by default, and played by audio player command line. | ||
Dictionary: | ||
- [Webster](http://www.merriam-webster.com/) | ||
- [Collins](http://www.collinsdictionary.com/) | ||
- [Yahoo](http://tw.dictionary.search.yahoo.com) | ||
@@ -30,2 +31,10 @@ | ||
or | ||
``` | ||
$ git clone https://github.com/zlargon/voc.git | ||
$ cd voc/ | ||
$ npm link | ||
``` | ||
## Usage | ||
@@ -41,2 +50,3 @@ | ||
-w, --webster force download audio from webster | ||
-c, --collins force download audio from collins | ||
-y, --yahoo force download audio from yahoo | ||
@@ -46,3 +56,3 @@ -g, --google force download audio from google | ||
-v, --voicerss force download audio from voicerss | ||
-a, --audio <cli> the command line to play .mp3 audio. set defaults to 'afplay' | ||
-a, --audio <cli> the command line for playing .mp3 audio | ||
-d, --dir <path> set the download directory. set defaults to '~/vocabulary' | ||
@@ -62,7 +72,22 @@ -l, --list list all the configuration | ||
## Audio Player Command Line | ||
* __MAC OSX :__ `afplay` | ||
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/afplay.1.html | ||
* __UNIX :__ `mpg123` | ||
http://www.mpg123.de/ | ||
* __Windows :__ `dlc` | ||
http://dlcplayer.jimdo.com/ | ||
## Configuration | ||
```bash | ||
$ voc -d ~/my_vocabulary # set download directory to '~/my_vocabulary' | ||
$ voc -a mplayer # set audio command line to 'mplayer' | ||
$ voc -d ~/my_vocabulary # set download directory to '~/my_vocabulary' | ||
$ voc -a "dlc -p" # set audio command line to 'dlc' with argument '-p' | ||
``` | ||
@@ -69,0 +94,0 @@ |
@@ -8,33 +8,4 @@ var fs = require('fs'); | ||
var coroutine = require('co'); | ||
var Service = require('./service'); | ||
var Service = { | ||
webster: { | ||
type: 'dic', | ||
getUrl: require('./webster') | ||
}, | ||
yahoo: { | ||
type: 'dic', | ||
getUrl: require('./yahoo') | ||
}, | ||
google: { | ||
type: 'tts', | ||
getUrl: require('./google'), | ||
ext: '.mp3' | ||
}, | ||
ispeech: { | ||
type: 'tts', | ||
getUrl: require('./ispeech'), | ||
ext: '.mp3' | ||
}, | ||
voicerss: { | ||
type: 'tts', | ||
getUrl: require('./voicerss'), | ||
ext: '.mp3' | ||
} | ||
}; | ||
function getExistAudio (word, directory) { | ||
@@ -41,0 +12,0 @@ var ext = ['.mp3', '.wav']; |
@@ -53,2 +53,10 @@ var fs = require('fs'); | ||
it('test-drive', function () { | ||
this.timeout(10000); | ||
var word = 'test-drive'; | ||
return expect(getAudio(word, __dirname, 'collins')).to.eventually.equal( | ||
path.resolve(__dirname, 'test-drive.mp3') | ||
); | ||
}); | ||
it('testing (from google)', function () { | ||
@@ -55,0 +63,0 @@ this.timeout(10000); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
39150
24
1093
93
6
11