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

bundle-me

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundle-me - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

.vscode/launch.json

13

package.json
{
"name": "bundle-me",
"version": "1.1.4",
"version": "1.1.5",
"description": "Bundles all the files inside the directory",

@@ -9,4 +9,4 @@ "main": "src/index.js",

"start": "node src/index.js",
"test": "mocha",
"jshint": "jshint",
"test": "mocha && npm run lint",
"lint": "jshint",
"clean": "rm -rf bundle-me.js bundle-me.css"

@@ -19,4 +19,9 @@ },

"allfiles",
"getAllFilenames"
"getAllFilenames",
"extension"
],
"repository": {
"type": "git",
"url": "https://github.com/pajaydev/bundle-me.git"
},
"author": "Ajaykumar Prathap",

@@ -23,0 +28,0 @@ "devDependencies": {

@@ -5,5 +5,3 @@ 'use strict';

const fs = require('fs');
const { join } = require('path');
function createBundle(options) {

@@ -37,3 +35,7 @@ if (!options) throw new Error("invalid input");

if (!options) throw new Error("invalid input");
if (!options.path) throw new Error("please provide valid input folder path");
if (!options.path){
options = {
path : options
};
};
const sourcePath = path.join(process.cwd(), options.path);

@@ -45,12 +47,7 @@ return iterateFiles(sourcePath, options.extn, []);

const files = getFiles(sourcePath);
fileArray.push(...files);
files.forEach(file => {
if (fs.statSync(file).isDirectory()) {
iterateFiles(file, extn, fileArray);
}
fs.statSync(file).isDirectory() ? iterateFiles(file, extn, fileArray): fileArray.push(file);
});
if (extn) {
fileArray = fileArray.filter((f) => {
return isExtnValid(f, extn);
})
fileArray = fileArray.filter((f) => isExtnValid(f, extn));
}

@@ -63,3 +60,3 @@ return fileArray;

if (fs.statSync(sourcePath).isDirectory()) {
return fs.readdirSync(sourcePath).map(file => join(sourcePath, file))
return fs.readdirSync(sourcePath).map(file => path.join(sourcePath, file))
}

@@ -83,3 +80,2 @@ return [sourcePath];

module.exports = {

@@ -86,0 +82,0 @@ getAllFiles,

@@ -13,7 +13,7 @@ 'use strict';

it("Test getAllFiles method", () => {
expect(getAllFiles({ path: 'static' }).length).to.equal(3);
expect(getAllFiles({ path: 'static' }).length).to.equal(4);
});
it("Test getAllFiles method with extn", () => {
expect(getAllFiles({ path: 'static', extn: 'js' }).length).to.equal(2);
expect(getAllFiles({ path: 'static', extn: 'js' }).length).to.equal(3);
expect(getAllFiles({ path: 'static', extn: 'css' }).length).to.equal(1);

@@ -20,0 +20,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