Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chimi

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chimi - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

11

bin/bin.js
#!/usr/bin/env node
const meow = require('meow')
const chalk = require('chalk')
const msg = `
Usage
$ chimi -f file
${chalk.bold.white('Usage')}
$ chimi -f <file> -c <config-file>
Options
${chalk.bold.white('Options')}
--file, -f File or glob matching multiple files (default: "README.md")
--config, -c Use configuration from this file (default: ".chimirc")
--config, -c Use configuration from this file (default: ".chimirc")
Examples
${chalk.bold.white('Examples')}
$ chimi -f README.md

@@ -14,0 +15,0 @@

@@ -59,3 +59,3 @@ # chimi example

console.log('I will never run')
},10 * 1000)
}, 10 * 1000)

@@ -33,3 +33,3 @@ const fs = require('fs')

? Either.Right(readConf(isJS, fromPkg, f))
: Either.Left(notExistMsg(f, file))
: file === '.chimirc' ? Either.Right({}) : Either.Left(notExistMsg(f, file))

@@ -36,0 +36,0 @@ return conf.map(R.merge(defaults))

@@ -90,3 +90,5 @@ const R = require('ramda')

// countCases :: List(FileResult) -> {files: Int, success: Int, success: Int}
// Cases :: {files: Int, success: Int, reject: Int, timeout: Int, total: Int }
// countCases :: List(FileResult) -> Cases
const countCases = results => {

@@ -97,3 +99,3 @@ const [success, reject, timeout] = reducers.map(reduceSnippets(results))

return { files: results.size, total, success, reject, timeout }
return { files: results.size, success, reject, timeout, total }
}

@@ -107,3 +109,3 @@

// reportResults :: Spinner -> String -> ([Object] -> ())
// reportResults :: Spinner -> String -> ([FileResult] -> Cases)
const reportResults = (spinner, glob) => results => {

@@ -145,3 +147,3 @@ const cases = countCases(results)

process.exit(Boolean(cases.reject) ? 1 : 0)
return cases
}

@@ -148,0 +150,0 @@

@@ -9,8 +9,12 @@ const { taskOfSnippets } = require('./lib')

return taskOfSnippets(dependencies, timeout, glob).fork(
error => spinner.fail(error.message),
reportResults(spinner, glob)
)
return taskOfSnippets(dependencies, timeout, glob)
.map(reportResults(spinner, glob))
.fork(
error => spinner.fail(error.message),
(results = { reject: 1 }) => {
process.exit(Boolean(results.reject) ? 1 : 0)
}
)
}
module.exports = runner
{
"name": "chimi",
"version": "0.0.3",
"version": "0.0.4",
"description": "Run JavaScript snippets from your markdown files",

@@ -11,8 +11,18 @@ "bin": {

"format": "npm run prettier -- --write 'lib/**/*.js' && npm run prettier -- --write 'bin/**/*.js'",
"babel": "babel runner.js -o runner.build.js",
"precommit": "lint-staged",
"release": "np"
},
"author": "",
"license": "ISC",
"author": "gillchristian <gillchristiang@gmail.com>",
"contributors": [
"fvictorio <victorio.franco@gmail.com>"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/Huemul/chimi.git"
},
"bugs": {
"url": "https://github.com/Huemul/chimi/issues"
},
"homepage": "https://github.com/Huemul/chimi#readme",
"dependencies": {

@@ -19,0 +29,0 @@ "chalk": "^1.1.3",

@@ -43,3 +43,3 @@ # chimi

The depenencies in the example will generate these `require`s:
```
```js
let trae = require('trae')

@@ -71,3 +71,3 @@ let _ = require('lodash')

- [x] CLI
- [x ] Configuration (`.chimi.js(on)?|.chimirc`).
- [x] Configuration (`.chimi.js(on)?|.chimirc`).
- [x] `--help`.

@@ -74,0 +74,0 @@ - [x] Log failures.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc