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

auto-watch-pages

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-watch-pages - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

11

handleRouter.js
const path = require('path');
const _ = require('lodash');
const cryptoFun = require('./cryptoFun');
const importList = [];

@@ -16,5 +17,11 @@

const newPath = newPathArray.join('/');
let routerNmae = newPathArray.join('/');
let importName = pathArray[pathArray.length - 1];
let hash = '';
routerNmae = '/' + routerNmae.substring(0, routerNmae.length - fileKey.length).toLowerCase();
importName = importName.substring(0, importName.length - 3);
hash = cryptoFun(importName + new Date().getTime());

@@ -27,3 +34,5 @@ // 当删除文件时删除对象

name: importName,
path: newPath
path: newPath,
routerNmae,
hash
})

@@ -30,0 +39,0 @@ }

const path = require('path');
const _ = require('lodash');
const cryptoFun = require('./cryptoFun');
const importList = [];

@@ -18,6 +19,9 @@

importName = importName.substring(0, importName.length - 3);
importName = cryptoFun(importName + new Date().getTime());
// 当删除文件时删除对象
if (event === 'unlink') {
importList = _.remove(importList, (obj) => obj.name !== importName);
_.remove(importList, (obj) => obj.name === importName);
} else {

@@ -24,0 +28,0 @@ importList.push({

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

const watchPages = watcher({

@@ -16,0 +17,0 @@ watchDirPath: config.dirPath, // 监测目录路径

2

package.json
{
"name": "auto-watch-pages",
"version": "1.1.4",
"version": "1.1.5",
"description": "",

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

const template= require('lodash').template;
const fs = require('fs-extra');
const argv = process.argv;
const param = argv[2];
const chokidar = require('chokidar');

@@ -11,2 +13,4 @@ const outputFile = function (buildFilePaths, tempFilePaths, tempDatas) {

fs.outputFileSync(bfp, template(temp)(data));
console.log(bfp + ': write file complete!')
})

@@ -34,2 +38,6 @@ }

outputFile(buildFilePaths, tempFilePaths, tempDatas);
if (param === '-prod') {
watcher.close();
}
ready = true;

@@ -36,0 +44,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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