New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grob-files

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grob-files - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

22

index.js

@@ -7,2 +7,4 @@ const fs = require('fs');

const rxSep = new RegExp(`[${path.sep}.]`);
const Smangle = require("string-mangle");
const util = require("util");
function isDirectory(filename) {

@@ -69,2 +71,19 @@ return fs.statSync(filename).isDirectory();

};
/**
* Make file object obtained to require calls
* @param {[type]} source [description]
* @param {[type]} ext [description]
* @return {[type]} [description]
*/
function getRequiredFile(source,ext){
const files = getFiles(source,ext,true);
// console.log("stringifyTree return--->",Smangle.stringifyTree(files));
return Smangle.stringifyTree(files);
}
/**
* Traverse file object to get filename
* @param {[type]} filesTree [description]
* @param {Function} fn [description]
* @return {[type]} [description]
*/
function traverse(filesTree, fn) {

@@ -82,3 +101,4 @@ Object.keys(filesTree).forEach((key) => {

getFiles,
traverse
traverse,
getRequiredFile
}

3

package.json
{
"name": "grob-files",
"version": "0.0.2",
"version": "0.0.3",
"description": "Find files with special suffix in one or many folders",

@@ -8,2 +8,3 @@ "main": "index.js",

"ramda": "^0.23.0",
"string-mangle": "0.0.4",
"winpath": "^0.0.1"

@@ -10,0 +11,0 @@ },

@@ -68,2 +68,22 @@ ### Install

(3)getRequiredFile(source,suffix)
Source and suffix as described above. Invoke this method you will get something like bellow:
```js
{
'filelists': {
'hello': require('C:/Users/Administrator/Desktop/find-files/filelists/hello.md'),
'index': require('C:/Users/Administrator/Desktop/find-files/filelists/index.md'),
'md': {
'fol': {
'index': require('C:/Users/Administrator/Desktop/find-files/filelists/md/fol/index.md')
},
'index': require('C:/Users/Administrator/Desktop/find-files/filelists/md/index.md')
}
}
}
```
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