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

afile

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

afile - npm Package Compare versions

Comparing version 0.3.2 to 1.0.0

30

index.js
'use strict';
var fs = require('fs');
const fs = require('fs');

@@ -30,20 +30,4 @@ function arrify(a) {

function findoneSync(targets) {
for (var i = 0; i < targets.length; ++i) {
try {
if (fs.statSync(targets[i]).isFile()) {
return targets[i];
}
} catch (e) {}
}
return null;
}
function afile(targets, cb) {
if (cb) {
return findone(arrify(targets), cb);
}
return findoneSync(arrify(targets));
return findone(arrify(targets), cb);
}

@@ -53,12 +37,6 @@

return new Promise(function (resolve, reject) {
afile(targets, function (f) {
if (f) {
resolve(f);
} else {
reject(new Error('Not found a file'));
}
afile(targets, f => {
return f ? resolve(f) : reject(new Error('Not found a file'));
});
});
};
module.exports.cb = module.exports.sync = afile;

8

package.json
{
"name": "afile",
"version": "0.3.2",
"version": "1.0.0",
"description": "Find a file on the list",

@@ -13,3 +13,3 @@ "license": "MIT",

"engines": {
"node": ">=0.4.0"
"node": ">=0.6.0"
},

@@ -29,5 +29,5 @@ "scripts": {

"devDependencies": {
"ava": "^0.9.1",
"xo": "^0.12.1"
"ava": "^0.15.2",
"xo": "^0.16.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