JSPM

gulp-dir-cipher

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q48848F
  • License ISC

gulp-dir-cipher

Package Exports

  • gulp-dir-cipher
  • gulp-dir-cipher/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-dir-cipher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-dir-cipher

gulp中间件: gulp-dir-cipher, 使用base64+blowfish的方式, 对整个目录下的所有文件进行加密, 包括加密文件名、目录名、文件内容

install

npm i gulp-dir-cipher

use

import gulp from 'gulp';
import gulpDirCipher, { checkPassword, encodeDirname, decodeDirname } from 'gulp-dir-cipher';

const password = 'juln1234';

if (!checkPassword(password)) {
  process.exit();
}

// encoding
gulp.src(['/Volumes/dev/gulp-dir-cipher/src/**/**', '!/Volumes/dev/gulp-dir-cipher/src'])
  .pipe(gulpDirCipher(password, 'encoding', { debug: true }))
  .pipe(gulp.dest('/Volumes/dev/gulp-dir-cipher/dist'))

setTimeout(() => {
  // decoding
  gulp.src(['/Volumes/dev/gulp-dir-cipher/dist/**/**', '!/Volumes/dev/gulp-dir-cipher/dist'])
    .pipe(gulpDirCipher(password, 'decoding', { debug: true }))
    .pipe(gulp.dest('/Volumes/dev/gulp-dir-cipher/dist/source'))
}, 2000)