cacheDir
This module is needed for caching data. It can search for files with certain extension in folders. Collect file contents or contents could be through a flaw require function. Also caches template files swigJs.
Installation
npm install utils-igor
example
var dirCache = ;var async = ;var ut = ; async;
- cacheDir
- module.exports :
Object
⏏- ~Frame
- .err(mess) ⇒
Object
- .warn(mess, that)
- .err(mess) ⇒
- ~Scan
- new Scan(options, cb)
- .valid(options)
- .beforeValid(options) ⇒
Object
- .iterValid(options, k, v) ⇒
boolean
- .isCorrectExt(file) ⇒
boolean
- .isAll() ⇒
boolean
- .run(cb) ⇒
*
- ~Swig
- ~Reader
- ~Reuired
- .beforeValid(options) ⇒
Object
- .fileGet(dir, file, endFile) ⇒
*
- .beforeValid(options) ⇒
- ~Cache
- ~Frame
- module.exports :
Object
⏏
module.exports : Exports classes
module.exports~Frame
It is a frame for other classes
Kind: inner class of module.exports
- ~Frame
- .err(mess) ⇒
Object
- .warn(mess, that)
- .err(mess) ⇒
Object
frame.err(mess) ⇒ Return error object and set flag for stop process
Kind: instance method of Frame
Param |
---|
mess |
frame.warn(mess, that)
Get text for message
Kind: instance method of Frame
Param | Type |
---|---|
mess | String |
that | Class |
module.exports~Scan
Search files in folders
Kind: inner class of module.exports
- ~Scan
- new Scan(options, cb)
- .valid(options)
- .beforeValid(options) ⇒
Object
- .iterValid(options, k, v) ⇒
boolean
- .isCorrectExt(file) ⇒
boolean
- .isAll() ⇒
boolean
- .run(cb) ⇒
*
new Scan(options, cb)
Set option to class and run callback
Param | Type |
---|---|
options | object |
cb | function |
scan.valid(options)
Validates options
Kind: instance method of Scan
Param | Type |
---|---|
options | Object |
Object
scan.beforeValid(options) ⇒ Hook before validates options
Kind: instance method of Scan
Param | Type |
---|---|
options | Object |
boolean
scan.iterValid(options, k, v) ⇒ Hook for iter validates options
Kind: instance method of Scan
Param | Type |
---|---|
options | Object |
k | String |
v | String |
boolean
scan.isCorrectExt(file) ⇒ Check extension file
Kind: instance method of Scan
Param | Type |
---|---|
file | String |
boolean
scan.isAll() ⇒ Check use all extension
Kind: instance method of Scan
*
scan.run(cb) ⇒ Start search process
Kind: instance method of Scan
Param | Type |
---|---|
cb | function |
module.exports~Swig
Get text swig template files and jon partial
Kind: inner class of module.exports
swig.run(cb)
Start collected process
Kind: instance method of Swig
Param | Type |
---|---|
cb | function |
swig.fileGet(dir, file, endFile)
Get text files
Kind: instance method of Swig
Param | Type |
---|---|
dir | String |
file | String |
endFile | function |
swig.fileToRes(pathFile, dir, file, data, cb)
Write text to result
Kind: instance method of Swig
Param | Type |
---|---|
pathFile | String |
dir | String |
file | String |
data | String |
cb | function |
*
swig.dataToRes(pathFile, dir, {Stringfile, {Stringdata, cb) ⇒ Write data to result
Kind: instance method of Swig
Param | Type |
---|---|
pathFile | String |
dir | String |
{Stringfile | |
{Stringdata | |
cb | function |
string
| XML
| *
| void
swig.oneLineBreak(data) ⇒ Clears data from the extra line breaks
Kind: instance method of Swig
Param | Type |
---|---|
data | String |
module.exports~Reader
Get text any files
Kind: inner class of module.exports
reader.fileToRes(pathFile, dir, file, data, endFile)
Write text to result
Kind: instance method of Reader
Param | Type |
---|---|
pathFile | String |
dir | String |
file | String |
data | String |
endFile | function |
module.exports~Reuired
Get files via function require
Kind: inner class of module.exports
- ~Reuired
- .beforeValid(options) ⇒
Object
- .fileGet(dir, file, endFile) ⇒
*
- .beforeValid(options) ⇒
Object
reuired.beforeValid(options) ⇒ Overwrite before valid
Kind: instance method of Reuired
Param | Type |
---|---|
options | String |
*
reuired.fileGet(dir, file, endFile) ⇒ Overwrite fileGet
Kind: instance method of Reuired
Param | Type |
---|---|
dir | String |
file | String |
endFile | function |
module.exports~Cache
Create object for saving data
Kind: inner class of module.exports