Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
f39daca6aa | |||
e70db71ec4 | |||
50ef41d5d4 | |||
2a417ba18f | |||
3516189940 | |||
10e3628a89 | |||
86eafe4568 | |||
fddde78b92 | |||
2a365b04a6 | |||
df1d82cb7c | |||
d20742f881 | |||
db2a0c2992 | |||
7d806f313b | |||
ff2e34696a | |||
23188dfe3f | |||
38f10e0d04 | |||
2e2b8351f8 | |||
8c386ee91c |
@ -28,6 +28,7 @@ testSTABLE:
|
||||
|
||||
release:
|
||||
stage: release
|
||||
environment: npm_registry
|
||||
script:
|
||||
- npmci publish
|
||||
only:
|
||||
|
11
dist/index.js
vendored
11
dist/index.js
vendored
@ -1,9 +1,9 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var SmartfileFs = require("./smartfile.fs");
|
||||
var SmartfileInterpreter = require("./smartfile.interpreter");
|
||||
var SmartfileMemory = require("./smartfile.memory");
|
||||
var SmartfileRemote = require("./smartfile.remote");
|
||||
const SmartfileFs = require("./smartfile.fs");
|
||||
const SmartfileInterpreter = require("./smartfile.interpreter");
|
||||
const SmartfileMemory = require("./smartfile.memory");
|
||||
const SmartfileRemote = require("./smartfile.remote");
|
||||
var smartfile_classes_smartfile_1 = require("./smartfile.classes.smartfile");
|
||||
exports.Smartfile = smartfile_classes_smartfile_1.Smartfile;
|
||||
exports.fs = SmartfileFs;
|
||||
@ -11,5 +11,4 @@ exports.interpreter = SmartfileInterpreter;
|
||||
exports.memory = SmartfileMemory;
|
||||
exports.remote = SmartfileRemote;
|
||||
exports.requireReload = SmartfileFs.requireReload;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFHeEIsSUFBWSxXQUFXLFdBQU0sZ0JBQWdCLENBQUMsQ0FBQTtB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cG9ydCBsZXQgbWVtb3J5ID0gU21hcnRmaWxlTWVtb3J5O1xuZXhwb3J0IGxldCByZW1vdGUgPSBTbWFydGZpbGVSZW1vdGU7XG5leHBvcnQgbGV0IHJlcXVpcmVSZWxvYWQgPSBTbWFydGZpbGVGcy5yZXF1aXJlUmVsb2FkO1xuIl19
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBR3hCLE1BQVksV0FBVyxXQUFNLGdCQUFnQixDQUFDLENBQUE7QUFDOUMsTUFBWSxvQkFBb0IsV0FBTSx5QkFDdEMsQ0FBQyxDQUQ4RDtBQUMvRCxNQUFZLGVBQWUsV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBQ3RELE1BQVksZUFBZSxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFdEQsNENBQXdCLCtCQUErQixDQUFDO0FBQWhELDREQUFnRDtBQUU3QyxVQUFFLEdBQUcsV0FBVyxDQUFDO0FBQ2pCLG1CQUFXLEdBQUcsb0JBQW9CLENBQUM7QUFDbkMsY0FBTSxHQUFHLGVBQWUsQ0FBQztBQUN6QixjQUFNLEdBQUcsZUFBZSxDQUFDO0FBQ3pCLHFCQUFhLEdBQUcsV0FBVyxDQUFDLGFBQWEsQ0FBQyJ9
|
10
dist/smartfile.classes.smartfile.js
vendored
10
dist/smartfile.classes.smartfile.js
vendored
@ -1,10 +1,8 @@
|
||||
"use strict";
|
||||
var Smartfile = (function () {
|
||||
function Smartfile() {
|
||||
class Smartfile {
|
||||
constructor() {
|
||||
}
|
||||
;
|
||||
return Smartfile;
|
||||
}());
|
||||
}
|
||||
exports.Smartfile = Smartfile;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5jbGFzc2VzLnNtYXJ0ZmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7SUFDSTtJQUVBLENBQUM7O0lBQ0wsZ0JBQUM7QUFBRCxDQUpBLEFBSUMsSUFBQTtBQUpZLGlCQUFTLFlBSXJCLENBQUEiLCJmaWxlIjoic21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIFNtYXJ0ZmlsZSB7XG4gICAgY29uc3RydWN0b3IoKXtcbiAgICAgICAgXG4gICAgfTtcbn0iXX0=
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtJQUNJO0lBRUEsQ0FBQzs7QUFDTCxDQUFDO0FBSlksaUJBQVMsWUFJckIsQ0FBQSJ9
|
17
dist/smartfile.fs.d.ts
vendored
17
dist/smartfile.fs.d.ts
vendored
@ -1,4 +1,6 @@
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
import plugins = require("./smartfile.plugins");
|
||||
/**
|
||||
*
|
||||
* @param filePath
|
||||
@ -10,7 +12,7 @@ export declare let fileExistsSync: (filePath: any) => boolean;
|
||||
* @param filePath
|
||||
* @returns {any}
|
||||
*/
|
||||
export declare let fileExists: (filePath: any) => any;
|
||||
export declare let fileExists: (filePath: any) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* Checks if given path points to an existing directory
|
||||
*/
|
||||
@ -22,7 +24,7 @@ export declare let isFile: (pathArg: any) => boolean;
|
||||
/**
|
||||
* ensures that a directory is in place
|
||||
*/
|
||||
export declare let ensureDir: (dirPathArg: string) => any;
|
||||
export declare let ensureDir: (dirPathArg: string) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* ensures that a directory is in place
|
||||
*/
|
||||
@ -30,7 +32,7 @@ export declare let ensureDirSync: (dirPathArg: string) => void;
|
||||
/**
|
||||
* copies a file from A to B on the local disk
|
||||
*/
|
||||
export declare let copy: (fromArg: string, toArg: string) => any;
|
||||
export declare let copy: (fromArg: string, toArg: string) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* copies a file SYNCHRONOUSLY from A to B on the local disk
|
||||
*/
|
||||
@ -38,7 +40,7 @@ export declare let copySync: (fromArg: string, toArg: string) => boolean;
|
||||
/**
|
||||
* removes a file or folder from local disk
|
||||
*/
|
||||
export declare let remove: (pathArg: string) => any;
|
||||
export declare let remove: (pathArg: string) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* removes a file SYNCHRONOUSLY from local disk
|
||||
*/
|
||||
@ -80,7 +82,7 @@ export declare let requireReload: (path: string) => any;
|
||||
* lists Folders in a directory on local disk
|
||||
* @returns Promise
|
||||
*/
|
||||
export declare let listFolders: (pathArg: string, regexFilter?: RegExp) => any;
|
||||
export declare let listFolders: (pathArg: string, regexFilter?: RegExp) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* lists Folders SYNCHRONOUSLY in a directory on local disk
|
||||
* @returns an array with the folder names as strings
|
||||
@ -90,7 +92,7 @@ export declare let listFoldersSync: (pathArg: string, regexFilter?: RegExp) => s
|
||||
* lists Files in a directory on local disk
|
||||
* @returns Promise
|
||||
*/
|
||||
export declare let listFiles: (pathArg: string, regexFilter?: RegExp) => any;
|
||||
export declare let listFiles: (pathArg: string, regexFilter?: RegExp) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* lists Files SYNCHRONOUSLY in a directory on local disk
|
||||
* @returns an array with the folder names as strings
|
||||
@ -100,9 +102,10 @@ export declare let listFilesSync: (pathArg: string, regexFilter?: RegExp) => str
|
||||
* lists all items (folders AND files) in a directory on local disk
|
||||
* @returns Promise
|
||||
*/
|
||||
export declare let listAllItems: (pathArg: string, regexFilter?: RegExp) => any;
|
||||
export declare let listAllItems: (pathArg: string, regexFilter?: RegExp) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
* lists all items (folders AND files) SYNCHRONOUSLY in a directory on local disk
|
||||
* @returns an array with the folder names as strings
|
||||
*/
|
||||
export declare let listAllItemsSync: (pathArg: string, regexFilter?: RegExp) => string[];
|
||||
export declare let listFileTree: (dirPath: string, miniMatchFilter: string) => plugins.Q.Promise<{}>;
|
||||
|
125
dist/smartfile.fs.js
vendored
125
dist/smartfile.fs.js
vendored
File diff suppressed because one or more lines are too long
13
dist/smartfile.interpreter.js
vendored
13
dist/smartfile.interpreter.js
vendored
@ -1,12 +1,12 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var plugins = require("./smartfile.plugins");
|
||||
exports.filetype = function (pathArg) {
|
||||
var extName = plugins.path.extname(pathArg);
|
||||
var fileType = extName.replace(/\.([a-z]*)/, "$1"); //remove . form fileType
|
||||
const plugins = require("./smartfile.plugins");
|
||||
exports.filetype = (pathArg) => {
|
||||
let extName = plugins.path.extname(pathArg);
|
||||
let fileType = extName.replace(/\.([a-z]*)/, "$1"); //remove . form fileType
|
||||
return fileType;
|
||||
};
|
||||
exports.objectFile = function (fileStringArg, fileTypeArg) {
|
||||
exports.objectFile = (fileStringArg, fileTypeArg) => {
|
||||
switch (fileTypeArg) {
|
||||
case "yml":
|
||||
case "yaml":
|
||||
@ -18,5 +18,4 @@ exports.objectFile = function (fileStringArg, fileTypeArg) {
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5pbnRlcnByZXRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0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CBmaWxldHlwZSA9IChwYXRoQXJnOnN0cmluZyk6c3RyaW5nID0+IHtcbiAgICBsZXQgZXh0TmFtZSA9IHBsdWdpbnMucGF0aC5leHRuYW1lKHBhdGhBcmcpO1xuICAgIGxldCBmaWxlVHlwZSA9IGV4dE5hbWUucmVwbGFjZSgvXFwuKFthLXpdKikvLFwiJDFcIik7IC8vcmVtb3ZlIC4gZm9ybSBmaWxlVHlwZVxuICAgIHJldHVybiBmaWxlVHlwZTtcbn07XG5cbmV4cG9ydCBsZXQgb2JqZWN0RmlsZSA9IChmaWxlU3RyaW5nQXJnOnN0cmluZywgZmlsZVR5cGVBcmcpID0+IHtcbiAgICBzd2l0Y2ggKGZpbGVUeXBlQXJnKSB7XG4gICAgICAgIGNhc2UgXCJ5bWxcIiA6XG4gICAgICAgIGNhc2UgXCJ5YW1sXCI6XG4gICAgICAgICAgICByZXR1cm4gcGx1Z2lucy55YW1sLnNhZmVMb2FkKGZpbGVTdHJpbmdBcmcpO1xuICAgICAgICBjYXNlIFwianNvblwiOlxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmlsZVN0cmluZ0FyZyk7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBwbHVnaW5zLmJlYXV0eWxvZy5lcnJvcihcImZpbGUgdHlwZSBcIiArIGZpbGVUeXBlQXJnLmJsdWUgKyBcIiBub3Qgc3VwcG9ydGVkXCIpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgfVxufSJdfQ==
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRmaWxlLmludGVycHJldGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRmaWxlLmludGVycHJldGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFFeEIsTUFBTyxPQUFPLFdBQVcscUJBQXFCLENBQUMsQ0FBQztBQUVyQyxnQkFBUSxHQUFHLENBQUMsT0FBYztJQUNqQyxJQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUM1QyxJQUFJLFFBQVEsR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLFlBQVksRUFBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLHdCQUF3QjtJQUMzRSxNQUFNLENBQUMsUUFBUSxDQUFDO0FBQ3BCLENBQUMsQ0FBQztBQUVTLGtCQUFVLEdBQUcsQ0FBQyxhQUFvQixFQUFFLFdBQVc7SUFDdEQsTUFBTSxDQUFDLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQztRQUNsQixLQUFLLEtBQUssQ0FBRTtRQUNaLEtBQUssTUFBTTtZQUNQLE1BQU0sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUNoRCxLQUFLLE1BQU07WUFDUCxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUNyQztZQUNJLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLFlBQVksR0FBRyxXQUFXLENBQUMsSUFBSSxHQUFHLGdCQUFnQixDQUFDLENBQUM7WUFDNUUsS0FBSyxDQUFDO0lBQ2QsQ0FBQztBQUNMLENBQUMsQ0FBQSJ9
|
4
dist/smartfile.memory.d.ts
vendored
4
dist/smartfile.memory.d.ts
vendored
@ -1,3 +1,5 @@
|
||||
/// <reference types="vinyl" />
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
import plugins = require("./smartfile.plugins");
|
||||
/**
|
||||
@ -45,5 +47,5 @@ export declare let toStringSync: (fileArg: plugins.vinyl) => string;
|
||||
* @param fileNameArg
|
||||
* @param fileBaseArg
|
||||
*/
|
||||
export declare let toFs: (fileContentArg: string | plugins.vinyl, filePathArg: any) => any;
|
||||
export declare let toFs: (fileContentArg: string | plugins.vinyl, filePathArg: any) => plugins.Q.Promise<{}>;
|
||||
export declare let toFsSync: (fileArg: any, filePathArg: string) => void;
|
||||
|
48
dist/smartfile.memory.js
vendored
48
dist/smartfile.memory.js
vendored
File diff suppressed because one or more lines are too long
8
dist/smartfile.plugins.d.ts
vendored
8
dist/smartfile.plugins.d.ts
vendored
@ -1,12 +1,14 @@
|
||||
import "typings-global";
|
||||
export declare let beautylog: any;
|
||||
export declare let fs: any;
|
||||
export import beautylog = require("beautylog");
|
||||
export import fs = require("fs");
|
||||
export import fsExtra = require("fs-extra");
|
||||
export declare let gulp: any;
|
||||
export import glob = require("glob");
|
||||
export declare let g: {
|
||||
remoteSrc: any;
|
||||
};
|
||||
export import path = require("path");
|
||||
export declare let q: any;
|
||||
export import Q = require("q");
|
||||
export import vinyl = require("vinyl");
|
||||
export declare let vinylFile: any;
|
||||
export declare let yaml: any;
|
||||
|
9
dist/smartfile.plugins.js
vendored
9
dist/smartfile.plugins.js
vendored
@ -1,17 +1,18 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
exports.beautylog = require("beautylog");
|
||||
exports.fs = require("fs-extra");
|
||||
exports.fs = require("fs");
|
||||
exports.fsExtra = require("fs-extra");
|
||||
exports.gulp = require("gulp");
|
||||
exports.glob = require("glob");
|
||||
exports.g = {
|
||||
remoteSrc: require("gulp-remote-src")
|
||||
};
|
||||
exports.path = require("path");
|
||||
exports.q = require("q");
|
||||
exports.Q = require("q");
|
||||
exports.vinyl = require("vinyl");
|
||||
exports.vinylFile = require("vinyl-file");
|
||||
exports.yaml = require("js-yaml");
|
||||
exports.request = require("request");
|
||||
exports.requireReload = require("require-reload");
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSw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UcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ2xDLFlBQUksR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDMUIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUM3QixxQkFBYSxHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDIn0=
|
8
dist/smartfile.remote.d.ts
vendored
8
dist/smartfile.remote.d.ts
vendored
@ -1,5 +1,7 @@
|
||||
/// <reference types="q" />
|
||||
import "typings-global";
|
||||
export declare let toFs: (from: string, toPath: string) => any;
|
||||
import plugins = require("./smartfile.plugins");
|
||||
export declare let toFs: (from: string, toPath: string) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
*
|
||||
* @param filePathArg
|
||||
@ -11,10 +13,10 @@ export declare let toGulpStreamSync: (filePathArg: string, baseArg: string) => a
|
||||
* @param fromArg
|
||||
* @returns {any}
|
||||
*/
|
||||
export declare let toObject: (fromArg: string) => any;
|
||||
export declare let toObject: (fromArg: string) => plugins.Q.Promise<{}>;
|
||||
/**
|
||||
*
|
||||
* @param fromArg
|
||||
* @returns {any}
|
||||
*/
|
||||
export declare let toString: (fromArg: string) => any;
|
||||
export declare let toString: (fromArg: string) => plugins.Q.Promise<{}>;
|
||||
|
21
dist/smartfile.remote.js
vendored
21
dist/smartfile.remote.js
vendored
File diff suppressed because one or more lines are too long
9
npmextra.json
Normal file
9
npmextra.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"npmts":{
|
||||
"mode":"default",
|
||||
"coverageTreshold":70
|
||||
},
|
||||
"npmdocker":{
|
||||
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"mode":"default",
|
||||
"codecov":true,
|
||||
"coverageTreshold":70
|
||||
}
|
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "smartfile",
|
||||
"version": "4.0.7",
|
||||
"version": "4.0.13",
|
||||
"description": "offers smart ways to work with files in nodejs",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
@ -26,22 +26,26 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartfile",
|
||||
"dependencies": {
|
||||
"beautylog": "^5.0.12",
|
||||
"@types/fs-extra": "0.x.x",
|
||||
"@types/glob": "5.x.x",
|
||||
"@types/q": "0.x.x",
|
||||
"beautylog": "^5.0.14",
|
||||
"fs-extra": "^0.30.0",
|
||||
"glob": "^7.0.5",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-remote-src": "^0.4.1",
|
||||
"js-yaml": "^3.6.1",
|
||||
"q": "^1.4.1",
|
||||
"request": "^2.72.0",
|
||||
"request": "^2.73.0",
|
||||
"require-reload": "0.2.2",
|
||||
"typings-global": "^1.0.3",
|
||||
"typings-global": "^1.0.6",
|
||||
"vinyl": "^1.1.1",
|
||||
"vinyl-file": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-function": "^1.3.6",
|
||||
"npmts-g": "^5.2.6",
|
||||
"should": "^9.0.2",
|
||||
"should": "^10.0.0",
|
||||
"typings-test": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
72
test/test.js
72
test/test.js
File diff suppressed because one or more lines are too long
32
test/test.ts
32
test/test.ts
@ -1,6 +1,6 @@
|
||||
import "typings-test";
|
||||
import * as smartfile from "../dist/index";
|
||||
let beautylog = require("beautylog");
|
||||
import beautylog = require("beautylog");
|
||||
let gulp = require("gulp");
|
||||
let gFunction = require("gulp-function");
|
||||
import path = require("path");
|
||||
@ -8,8 +8,6 @@ import should = require("should");
|
||||
let vinyl = require("vinyl");
|
||||
|
||||
describe("smartfile".yellow,function(){
|
||||
|
||||
|
||||
describe(".fs".yellow,function(){
|
||||
describe(".fileExistsSync".yellow,function(){
|
||||
it("should return an accurate boolean",function(){
|
||||
@ -40,6 +38,34 @@ describe("smartfile".yellow,function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
describe(".listFilesSync()",function(){
|
||||
it("should get the file type from a string",function(){
|
||||
smartfile.fs.listFilesSync("./test/").should.containDeep([ "mytest.json"]);
|
||||
smartfile.fs.listFilesSync("./test/").should.not.containDeep([ "notExistentFile"]);
|
||||
smartfile.fs.listFilesSync("./test/",/mytest\.json/).should.containDeep([ "mytest.json"]);
|
||||
smartfile.fs.listFilesSync("./test/",/mytests.json/).should.not.containDeep([ "mytest.json"]);
|
||||
});
|
||||
});
|
||||
describe(".listFiles()",function(){
|
||||
it("should get the file type from a string",function(done){
|
||||
smartfile.fs.listFiles("./test/")
|
||||
.then(function(folderArrayArg){
|
||||
folderArrayArg.should.containDeep([ "mytest.json"]);
|
||||
folderArrayArg.should.not.containDeep([ "notExistentFile"]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
describe(".listFileTree()",function(){
|
||||
it("should get a file tree",function(done){
|
||||
smartfile.fs.listFileTree(path.resolve("./test/"),"**/*.txt")
|
||||
.then(function(folderArrayArg){
|
||||
folderArrayArg.should.containDeep([ "testfolder/testfile1.txt"]);
|
||||
folderArrayArg.should.not.containDeep([ "mytest.json"]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
describe(".copy()".yellow,function(){
|
||||
it("should copy a directory",function(){
|
||||
smartfile.fs.copy("./test/testfolder/","./test/temp/")
|
||||
|
@ -15,7 +15,7 @@ import SmartfileInterpreter = require("./smartfile.interpreter");
|
||||
export let fileExistsSync = function(filePath):boolean {
|
||||
let fileExistsBool:boolean = false;
|
||||
try {
|
||||
plugins.fs.readFileSync(filePath);
|
||||
plugins.fsExtra.readFileSync(filePath);
|
||||
fileExistsBool = true
|
||||
}
|
||||
catch(err){
|
||||
@ -30,9 +30,9 @@ export let fileExistsSync = function(filePath):boolean {
|
||||
* @returns {any}
|
||||
*/
|
||||
export let fileExists = function(filePath){
|
||||
let done = plugins.q.defer();
|
||||
let done = plugins.Q.defer();
|
||||
plugins.fs.access(filePath, plugins.fs.R_OK, function (err) {
|
||||
err ? done.reject() : done.resolve();
|
||||
err ? done.reject(err) : done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
@ -41,14 +41,14 @@ export let fileExists = function(filePath){
|
||||
* Checks if given path points to an existing directory
|
||||
*/
|
||||
export let isDirectory = function(pathArg):boolean{
|
||||
return plugins.fs.statSync(pathArg).isDirectory();
|
||||
return plugins.fsExtra.statSync(pathArg).isDirectory();
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if a given path points to an existing file
|
||||
*/
|
||||
export let isFile = function(pathArg):boolean{
|
||||
return plugins.fs.statSync(pathArg).isFile();
|
||||
return plugins.fsExtra.statSync(pathArg).isFile();
|
||||
};
|
||||
|
||||
/*===============================================================
|
||||
@ -59,8 +59,8 @@ export let isFile = function(pathArg):boolean{
|
||||
* ensures that a directory is in place
|
||||
*/
|
||||
export let ensureDir = (dirPathArg:string) => {
|
||||
let done = plugins.q.defer();
|
||||
plugins.fs.ensureDir(dirPathArg,done.resolve);
|
||||
let done = plugins.Q.defer();
|
||||
plugins.fsExtra.ensureDir(dirPathArg,done.resolve);
|
||||
return done.promise;
|
||||
}
|
||||
|
||||
@ -68,15 +68,15 @@ export let ensureDir = (dirPathArg:string) => {
|
||||
* ensures that a directory is in place
|
||||
*/
|
||||
export let ensureDirSync = (dirPathArg:string) => {
|
||||
plugins.fs.ensureDirSync(dirPathArg);
|
||||
plugins.fsExtra.ensureDirSync(dirPathArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* copies a file from A to B on the local disk
|
||||
*/
|
||||
export let copy = function(fromArg:string, toArg:string){
|
||||
var done = plugins.q.defer();
|
||||
plugins.fs.copy(fromArg,toArg,{},function(){
|
||||
var done = plugins.Q.defer();
|
||||
plugins.fsExtra.copy(fromArg,toArg,{},function(){
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
@ -86,7 +86,7 @@ export let copy = function(fromArg:string, toArg:string){
|
||||
* copies a file SYNCHRONOUSLY from A to B on the local disk
|
||||
*/
|
||||
export let copySync = function(fromArg:string,toArg:string):boolean{
|
||||
plugins.fs.copySync(fromArg,toArg);
|
||||
plugins.fsExtra.copySync(fromArg,toArg);
|
||||
return true;
|
||||
};
|
||||
|
||||
@ -94,8 +94,8 @@ export let copySync = function(fromArg:string,toArg:string):boolean{
|
||||
* removes a file or folder from local disk
|
||||
*/
|
||||
export let remove = function(pathArg:string){
|
||||
var done = plugins.q.defer();
|
||||
plugins.fs.remove(pathArg,function(){
|
||||
var done = plugins.Q.defer();
|
||||
plugins.fsExtra.remove(pathArg,function(){
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
@ -105,7 +105,7 @@ export let remove = function(pathArg:string){
|
||||
* removes a file SYNCHRONOUSLY from local disk
|
||||
*/
|
||||
export let removeSync = function(pathArg:string):boolean{
|
||||
plugins.fs.removeSync(pathArg);
|
||||
plugins.fsExtra.removeSync(pathArg);
|
||||
return true;
|
||||
};
|
||||
|
||||
@ -135,7 +135,7 @@ export let toGulpDestSync = function(folderPathArg:string){
|
||||
* @returns {any}
|
||||
*/
|
||||
export let toObjectSync = function(filePathArg,fileTypeArg?) {
|
||||
let fileString = plugins.fs.readFileSync(filePathArg, 'utf8');
|
||||
let fileString = plugins.fsExtra.readFileSync(filePathArg, 'utf8');
|
||||
let fileType;
|
||||
fileTypeArg ? fileType = fileTypeArg : fileType = SmartfileInterpreter.filetype(filePathArg);
|
||||
return SmartfileInterpreter.objectFile(fileString,fileType);
|
||||
@ -148,7 +148,7 @@ export let toObjectSync = function(filePathArg,fileTypeArg?) {
|
||||
*/
|
||||
export let toStringSync = function(filePath) {
|
||||
let fileString;
|
||||
fileString = plugins.fs.readFileSync(filePath, "utf8");
|
||||
fileString = plugins.fsExtra.readFileSync(filePath, "utf8");
|
||||
return fileString;
|
||||
};
|
||||
|
||||
@ -176,13 +176,13 @@ export let requireReload = function(path:string){
|
||||
* @returns Promise
|
||||
*/
|
||||
export let listFolders = function(pathArg:string,regexFilter?:RegExp){
|
||||
let done = plugins.q.defer();
|
||||
let folderArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isDirectory();
|
||||
let done = plugins.Q.defer();
|
||||
let folderArray = plugins.fsExtra.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fsExtra.statSync(plugins.path.join(pathArg, file)).isDirectory();
|
||||
});
|
||||
if(regexFilter){
|
||||
folderArray = folderArray.filter((fileItem) => {
|
||||
regexFilter.test(fileItem);
|
||||
return regexFilter.test(fileItem);
|
||||
});
|
||||
}
|
||||
done.resolve(folderArray);
|
||||
@ -194,12 +194,12 @@ export let listFolders = function(pathArg:string,regexFilter?:RegExp){
|
||||
* @returns an array with the folder names as strings
|
||||
*/
|
||||
export let listFoldersSync = function(pathArg:string,regexFilter?:RegExp):string[]{
|
||||
let folderArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isDirectory();
|
||||
let folderArray = plugins.fsExtra.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fsExtra.statSync(plugins.path.join(pathArg, file)).isDirectory();
|
||||
});
|
||||
if(regexFilter){
|
||||
folderArray = folderArray.filter((fileItem) => {
|
||||
regexFilter.test(fileItem);
|
||||
return regexFilter.test(fileItem);
|
||||
});
|
||||
};
|
||||
return folderArray;
|
||||
@ -211,17 +211,17 @@ export let listFoldersSync = function(pathArg:string,regexFilter?:RegExp):string
|
||||
* @returns Promise
|
||||
*/
|
||||
export let listFiles = function(pathArg:string, regexFilter?:RegExp){
|
||||
let done = plugins.q.defer();
|
||||
let fileArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isFile();
|
||||
let done = plugins.Q.defer();
|
||||
let fileArray = plugins.fsExtra.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fsExtra.statSync(plugins.path.join(pathArg, file)).isFile();
|
||||
});
|
||||
if(regexFilter){
|
||||
fileArray = fileArray.filter((fileItem) => {
|
||||
regexFilter.test(fileItem);
|
||||
return regexFilter.test(fileItem);
|
||||
});
|
||||
};
|
||||
done.resolve(fileArray);
|
||||
return done.promise();
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -229,12 +229,12 @@ export let listFiles = function(pathArg:string, regexFilter?:RegExp){
|
||||
* @returns an array with the folder names as strings
|
||||
*/
|
||||
export let listFilesSync = function(pathArg:string, regexFilter?:RegExp):string[]{
|
||||
let fileArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isFile();
|
||||
let fileArray = plugins.fsExtra.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fsExtra.statSync(plugins.path.join(pathArg, file)).isFile();
|
||||
});
|
||||
if(regexFilter){
|
||||
fileArray = fileArray.filter((fileItem) => {
|
||||
regexFilter.test(fileItem);
|
||||
return regexFilter.test(fileItem);
|
||||
});
|
||||
};
|
||||
return fileArray;
|
||||
@ -245,15 +245,15 @@ export let listFilesSync = function(pathArg:string, regexFilter?:RegExp):string[
|
||||
* @returns Promise
|
||||
*/
|
||||
export let listAllItems = function(pathArg:string, regexFilter?:RegExp){
|
||||
let done = plugins.q.defer();
|
||||
let allItmesArray = plugins.fs.readdirSync(pathArg);
|
||||
let done = plugins.Q.defer();
|
||||
let allItmesArray = plugins.fsExtra.readdirSync(pathArg);
|
||||
if(regexFilter){
|
||||
allItmesArray = allItmesArray.filter((fileItem) => {
|
||||
regexFilter.test(fileItem);
|
||||
return regexFilter.test(fileItem);
|
||||
});
|
||||
};
|
||||
done.resolve(allItmesArray);
|
||||
return done.promise();
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -261,15 +261,28 @@ export let listAllItems = function(pathArg:string, regexFilter?:RegExp){
|
||||
* @returns an array with the folder names as strings
|
||||
*/
|
||||
export let listAllItemsSync = function(pathArg:string, regexFilter?:RegExp):string[]{
|
||||
let allItmesArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isFile();
|
||||
let allItmesArray = plugins.fsExtra.readdirSync(pathArg).filter(function(file) {
|
||||
return plugins.fsExtra.statSync(plugins.path.join(pathArg, file)).isFile();
|
||||
});
|
||||
if(regexFilter){
|
||||
allItmesArray = allItmesArray.filter((fileItem) => {
|
||||
regexFilter.test(fileItem);
|
||||
return regexFilter.test(fileItem);
|
||||
});
|
||||
};
|
||||
return allItmesArray;
|
||||
};
|
||||
|
||||
|
||||
export let listFileTree = (dirPath:string, miniMatchFilter:string) => {
|
||||
let done = plugins.Q.defer();
|
||||
let options = {
|
||||
cwd:dirPath
|
||||
}
|
||||
plugins.glob(miniMatchFilter,options,(err,files:string[]) => {
|
||||
if(err){
|
||||
console.log(err);
|
||||
done.reject(err);
|
||||
};
|
||||
done.resolve(files);
|
||||
});
|
||||
return done.promise;
|
||||
};
|
@ -98,7 +98,7 @@ export let toStringSync = function(fileArg:plugins.vinyl){
|
||||
* @param fileBaseArg
|
||||
*/
|
||||
export let toFs = function(fileContentArg:string|vinyl,filePathArg){
|
||||
let done = plugins.q.defer();
|
||||
let done = plugins.Q.defer();
|
||||
|
||||
//function checks to abort if needed
|
||||
if (!fileContentArg || !filePathArg) throw new Error("expected valid arguments");
|
||||
@ -111,7 +111,7 @@ export let toFs = function(fileContentArg:string|vinyl,filePathArg){
|
||||
} else if (typeof fileContentArg === "string") {
|
||||
fileString = fileContentArg;
|
||||
}
|
||||
plugins.fs.writeFile(filePath,fileString,"utf8",done.resolve);
|
||||
plugins.fsExtra.writeFile(filePath,fileString,"utf8",done.resolve);
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
@ -128,6 +128,6 @@ export let toFsSync = function(fileArg,filePathArg:string){
|
||||
} else if (typeof fileArg === "string") {
|
||||
fileString = fileArg;
|
||||
}
|
||||
plugins.fs.writeFileSync(filePath,fileString,"utf8");
|
||||
plugins.fsExtra.writeFileSync(filePath,fileString,"utf8");
|
||||
};
|
||||
|
||||
|
@ -1,12 +1,14 @@
|
||||
import "typings-global";
|
||||
export let beautylog = require("beautylog");
|
||||
export let fs = require("fs-extra");
|
||||
export import beautylog = require("beautylog");
|
||||
export import fs = require("fs");
|
||||
export import fsExtra = require("fs-extra");
|
||||
export let gulp = require("gulp");
|
||||
export import glob = require("glob");
|
||||
export let g = {
|
||||
remoteSrc: require("gulp-remote-src")
|
||||
};
|
||||
export import path = require("path");
|
||||
export let q = require("q");
|
||||
export import Q = require("q");
|
||||
export import vinyl = require("vinyl");
|
||||
export let vinylFile = require("vinyl-file");
|
||||
export let yaml = require("js-yaml");
|
||||
|
@ -3,8 +3,8 @@ import plugins = require("./smartfile.plugins");
|
||||
import SmartfileInterpreter = require("./smartfile.interpreter");
|
||||
|
||||
export let toFs = function(from:string,toPath:string) {
|
||||
var done = plugins.q.defer();
|
||||
var stream = plugins.request(from).pipe(plugins.fs.createWriteStream(toPath));
|
||||
var done = plugins.Q.defer();
|
||||
var stream = plugins.request(from).pipe(plugins.fsExtra.createWriteStream(toPath));
|
||||
stream.on('finish',function(){
|
||||
done.resolve(toPath);
|
||||
});
|
||||
@ -29,7 +29,7 @@ export let toGulpStreamSync = function(filePathArg:string,baseArg:string){
|
||||
* @returns {any}
|
||||
*/
|
||||
export let toObject = function(fromArg:string){
|
||||
let done = plugins.q.defer();
|
||||
let done = plugins.Q.defer();
|
||||
plugins.request.get(fromArg, function (error, response, bodyString) {
|
||||
let returnObject;
|
||||
if (!error && response.statusCode == 200) {
|
||||
@ -50,7 +50,7 @@ export let toObject = function(fromArg:string){
|
||||
* @returns {any}
|
||||
*/
|
||||
export let toString = (fromArg:string) => {
|
||||
let done = plugins.q.defer();
|
||||
let done = plugins.Q.defer();
|
||||
plugins.request.get(fromArg, function (error, response, bodyString) {
|
||||
if (!error && response.statusCode == 200) {
|
||||
done.resolve(bodyString);
|
||||
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"globalDependencies": {
|
||||
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts",
|
||||
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
||||
"node": "registry:dt/node",
|
||||
"should": "registry:dt/should"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user