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

es-check

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-check - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

tests/pkg.js/es5.js

29

index.js

@@ -31,3 +31,3 @@ #!/usr/bin/env node

'a glob of files to to test the EcmaScript version against'
).action((args, options, logger) => {
).action((args, options, logger) => {
const v = args.ecmaVersion

@@ -72,7 +72,9 @@ const files = args.files

const errors = []
const errFiles = []
const globOpts = { nodir: true }
const acornOpts = { ecmaVersion: e, silent: true }
files.forEach((pattern) => {
// pattern => glob or array
const globbedFiles = glob.sync(pattern)
const globbedFiles = glob.sync(pattern, globOpts)

@@ -82,8 +84,6 @@ globbedFiles.forEach((file) => {

try {
const result = acorn.parse(code, {
ecmaVersion: e,
silent: true,
})
acorn.parse(code, acornOpts)
} catch (err) {
errors.push(file)
logger.debug(`ES-Check: failed to parse file: ${file} \n - error: ${err}`)
errFiles.push(file)
}

@@ -93,14 +93,13 @@ })

if (errors.length > 0) {
logger.error(`ES-check: there were ${errors.length} ES version matching errors.`)
errors.forEach((error) => {
logger.info(`\n es-check: error in: ${error}`)
if (errFiles.length > 0) {
logger.error(`ES-Check: there were ${errFiles.length} ES version matching errors.`)
errFiles.forEach((file) => {
logger.info(`\n ES-Check: error in: ${file}`)
})
process.exit(1)
return
} else {
logger.error(`ES-check: there were no ES version matching errors! 🎉`)
logger.error(`ES-Check: there were no ES version matching errors! 🎉`)
}
})
prog.parse(process.argv)
prog.parse(argsArray)
{
"name": "es-check",
"version": "1.0.3",
"version": "1.0.4",
"description": "Checks the EcamScript version of .js glob against a specified version of EcamScript with a shell command",

@@ -5,0 +5,0 @@ "main": "index.js",

'use strict'
const exec = require('child_process').exec
const globby = require('globby')
const assert = require('assert')

@@ -6,0 +5,0 @@

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