Comparing version 0.0.5 to 0.0.6
@@ -13,17 +13,9 @@ // ### Usage | ||
if (path.resolve(args[0]) === __filename) { | ||
args.pop(); | ||
args.shift(); | ||
} | ||
args = args.reduce(function(args, arg){ | ||
if (!(arg = resolve(cwd, arg))) { | ||
console.log('Unable to find "'+arg+'"'); | ||
return args; | ||
} | ||
args.push(arg); | ||
return args; | ||
}, []); | ||
args = args.map(path.resolve); | ||
runnable(args, function(result){ | ||
result.forEach(console.log); | ||
}); |
@@ -0,11 +1,16 @@ | ||
var fs = require('fs'); | ||
var registry = require('./registry'); | ||
var fonts = require('./fonts'); | ||
var font = require('font'); | ||
function suitableFonts(){ | ||
return fonts.getNames().TrueType.filter(function(s){ return /mono/i.test(s) && !/ita|oblique/i.test(s) }); | ||
return fonts.getNames().TrueType.filter(function(s){ return !/ita|oblique/i.test(s) }); | ||
} | ||
function addFont(name){ | ||
var key = (Math.random() * 1000 | 0).toString(); | ||
var confonts = consoleFonts(); | ||
var key = ''; | ||
while ((key += String('0')) in confonts); | ||
return consoleFonts().add(key, name); | ||
@@ -20,5 +25,36 @@ } | ||
//fs.writeFileSync('fontinfo.js', require('util').inspect(x, null, 6)) | ||
//console.log(font.listFonts().filter(function(s){ return /mono/i.test(s) && !/ita|oblique/i.test(s) })) | ||
console.log(suitableFonts()); | ||
//console.log(font.loadFont('DejaVuSans.ttf')) | ||
/* | ||
'DejaVuSans-Bold.ttf', | ||
'DejaVuSans-BoldOblique.ttf', | ||
'DejaVuSans-ExtraLight.ttf', | ||
'DejaVuSans-Oblique.ttf', | ||
'DejaVuSans.ttf', | ||
'DejaVuSansCondensed-Bold.ttf', | ||
'DejaVuSansCondensed-BoldOblique.ttf', | ||
'DejaVuSansCondensed-Oblique.ttf', | ||
'DejaVuSansCondensed.ttf', | ||
'DejaVuSansMono-Bold.ttf', | ||
'DejaVuSansMono-BoldOblique.ttf', | ||
'DejaVuSansMono-Oblique.ttf', | ||
'DejaVuSansMono.ttf', | ||
'DejaVuSansMonoCond.ttf', | ||
'DejaVuSansMonoExtraCond.ttf', | ||
'DejaVuSansMono_0.ttf', | ||
'DejaVuSerif-Bold.ttf', | ||
'DejaVuSerif-BoldItalic.ttf', | ||
'DejaVuSerif-Italic.ttf', | ||
'DejaVuSerif.ttf', | ||
'DejaVuSerifCondensed-Bold.ttf', | ||
'DejaVuSerifCondensed-BoldItalic.ttf', | ||
'DejaVuSerifCondensed-Italic.ttf', | ||
'DejaVuSerifCondensed.ttf',*/ | ||
//consoleFonts()["TheSansMono-Light"].remove(); | ||
//console.log(addFont("Lucida Console")); | ||
//console.log(consoleFonts()); | ||
//suitableFonts().filter(function(s){ return !/bold|cond/i.test(s) }).map(addFont) | ||
@@ -25,0 +61,0 @@ |
var registry = require('./registry'); | ||
module.exports = { | ||
@@ -23,1 +21,3 @@ getList: getList, | ||
} | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var exists = require('./utility').exists; | ||
var resolve = require('./utility').resolve; | ||
var PATH = process.env.Path.split(';').filter(function(s){ return ~s.indexOf('node') }); | ||
if (PATH.length === 1) { | ||
PATH = PATH[0]; | ||
} else if (PATH.length > 1) { | ||
var bin = PATH.filter(function(s){ return ~s.indexOf('bin') }); | ||
if (bin.length === 1) { | ||
PATH = bin[0]; | ||
} else if (bin.length > 1) { | ||
PATH = bin.map(function(s){ return path.relative(__filename, s) }).sort(function(a,b){ return a.length - b.length })[0] | ||
} | ||
} | ||
if (!exists(PATH)) { | ||
if (process.env.NODE_PATH) PATH = process.env.NODE_PATH | ||
} else { | ||
throw new Error('Could not find a good path to install to'); | ||
} | ||
module.exports = function runnable(files){ | ||
return files.map(function(file){ | ||
if (exists(file)) { | ||
var parts = { | ||
dir: path.dirname(file), | ||
base: path.basename(file), | ||
ext: path.extname(file) | ||
}; | ||
parts.name = parts.base.slice(0, -parts.ext.length); | ||
console.log(parts); | ||
var cmdfile = path.resolve(PATH, parts.name+'.cmd'); | ||
fs.writeFileSync(cmdfile, '@node "'+path.join(parts.dir, parts.base)+'" %*'); | ||
return cmdfile + ' succesfully created'; | ||
} else { | ||
return file + ' not found'; | ||
} | ||
}); | ||
} | ||
/* | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var npm = require('npm'); | ||
@@ -28,2 +77,3 @@ | ||
}); | ||
} | ||
} | ||
*/ |
@@ -7,3 +7,3 @@ { | ||
"utility", "os", "platform", "drive alias", "windows sdk"], | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"homepage": "https://github.com/Benvie/node-Windows", | ||
@@ -16,4 +16,4 @@ "repository": { | ||
"bin": { | ||
"cwddrive": "./bin/cwddrive", | ||
"makerunnable": "./bin/makerunnable" | ||
"cwddrive": "./bin/cwddrive.js", | ||
"makerunnable": "./bin/makerunnable.js" | ||
}, | ||
@@ -20,0 +20,0 @@ "engines": { |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
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
53547
26
1151
14
6