add mksec r

dependabot/npm_and_yarn/y18n-4.0.1
iotcat 4 years ago
parent 327d00440d
commit 339645d818
  1. 2
      package.json
  2. 110
      src/.gitignore
  3. 24
      src/modules/mksec.js

@ -1,6 +1,6 @@
{
"name": "mksec",
"version": "2.3.1",
"version": "2.4.0",
"main": "src/index.js",
"repository": "git@github.com:IoTcat/sentence-generator.git",
"author": "iotcat <i@iotcat.me>",

110
src/.gitignore vendored

@ -0,0 +1,110 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# test files
*.csv
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# data files
data/
# TernJS port file
.tern-port

@ -76,6 +76,30 @@ module.exports = yargs => {
})
.command('r', "mksec r".green + " Check word list file with random order..", yargs => yargs, async argv => {
let s = fs.readFileSync(argv._[1], 'utf-8');
let wArr = s.match(/\b[a-zA-Z]+\b/g);
wArr = wArr.sort(()=>Math.random() - 0.5);
let count = 0;
for(let index = 0; index < wArr.length; index ++){
wArr[index] = wArr[index].toLowerCase();
ban = new ora(`Searching ${wArr[index]}...`).start();
try{
let arr = (await mksec({word: wArr[index]}));
count++;
ban.info('Found '+wArr[index]);
}catch(e){
ban.fail('Not found '+wArr[index]);
}
}
ban.succeed('Found '+wArr.length+' words, verified '+ count +' words.');
})

Loading…
Cancel
Save