Comparing version 1.1.4 to 1.2.0
@@ -0,3 +1,4 @@ | ||
module.exports.guessFile = require('./logic/guess-file'); | ||
module.exports.smartRead = require('./logic/smart-read'); | ||
module.exports.smartWrite = require('./logic/smart-write'); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwic21hcnRSZWFkIiwicmVxdWlyZSIsInNtYXJ0V3JpdGUiXSwibWFwcGluZ3MiOiJBQUNBQSxNQUFNLENBQUNDLE9BQVAsQ0FBZUMsU0FBZixHQUEyQkMsT0FBTyxDQUFDLG9CQUFELENBQWxDO0FBQ0FILE1BQU0sQ0FBQ0MsT0FBUCxDQUFlRyxVQUFmLEdBQTRCRCxPQUFPLENBQUMscUJBQUQsQ0FBbkMiLCJzb3VyY2VzQ29udGVudCI6WyJcbm1vZHVsZS5leHBvcnRzLnNtYXJ0UmVhZCA9IHJlcXVpcmUoJy4vbG9naWMvc21hcnQtcmVhZCcpO1xubW9kdWxlLmV4cG9ydHMuc21hcnRXcml0ZSA9IHJlcXVpcmUoJy4vbG9naWMvc21hcnQtd3JpdGUnKTtcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiZ3Vlc3NGaWxlIiwicmVxdWlyZSIsInNtYXJ0UmVhZCIsInNtYXJ0V3JpdGUiXSwibWFwcGluZ3MiOiJBQUNBQSxNQUFNLENBQUNDLE9BQVAsQ0FBZUMsU0FBZixHQUEyQkMsT0FBTyxDQUFDLG9CQUFELENBQWxDO0FBRUFILE1BQU0sQ0FBQ0MsT0FBUCxDQUFlRyxTQUFmLEdBQTJCRCxPQUFPLENBQUMsb0JBQUQsQ0FBbEM7QUFDQUgsTUFBTSxDQUFDQyxPQUFQLENBQWVJLFVBQWYsR0FBNEJGLE9BQU8sQ0FBQyxxQkFBRCxDQUFuQyIsInNvdXJjZXNDb250ZW50IjpbIlxubW9kdWxlLmV4cG9ydHMuZ3Vlc3NGaWxlID0gcmVxdWlyZSgnLi9sb2dpYy9ndWVzcy1maWxlJyk7XG5cbm1vZHVsZS5leHBvcnRzLnNtYXJ0UmVhZCA9IHJlcXVpcmUoJy4vbG9naWMvc21hcnQtcmVhZCcpO1xubW9kdWxlLmV4cG9ydHMuc21hcnRXcml0ZSA9IHJlcXVpcmUoJy4vbG9naWMvc21hcnQtd3JpdGUnKTtcbiJdfQ== |
{ | ||
"name": "smart-fs", | ||
"version": "1.1.4", | ||
"version": "1.2.0", | ||
"description": "Abstraction Layer for File Management.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -20,4 +20,11 @@ # smart-fs | ||
To ignore file extension and force treat the file as a certain type, you can pass the option `treatAs` as e.g. `json`. | ||
### guessFile(filepath) | ||
Extends and returns filepath with the file extension as appropriate. Returns `null` if no good match was found. | ||
A few notes: | ||
- Only extends extensions, not partial file names | ||
- Will prefer to match the exact file | ||
- Will return `null` when multiple possible extensions are found | ||
### smartRead(filepath, options = { treatAs = null }) | ||
@@ -36,2 +43,4 @@ | ||
To ignore file extension and force treat the file as a certain type, you can pass the option `treatAs` as e.g. `json`. | ||
### smartWrite(filepath. content, options = { treatAs = null, mergeStrategy = (existing, changeset) => changeset }) | ||
@@ -52,2 +61,4 @@ | ||
To ignore file extension and force treat the file as a certain type, you can pass the option `treatAs` as e.g. `json`. | ||
The `mergeStrategy` option can be used to customize how the new content is merged if the target file already exists. | ||
@@ -54,0 +65,0 @@ By default the file is simply overwritten. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23558
8
102
67
5