{"name":"fs-sync","version":"1.0.7","description":"synchronous fs with more fun","main":"index.js","scripts":{"test":"mocha --reporter spec ./test/*.js"},"author":{"name":"kael"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/kaelzhang/node-fs-sync.git"},"bugs":{"url":"https://github.com/kaelzhang/node-fs-sync/issues"},"keywords":["fs","fs-sync","sync","synchronous fs","copy","mkdir","mkdirp","write","read","readJSON","isDir","isFile","isLink","exists","grunt file","delete","expand","contain"],"dependencies":{"glob":"^7.1.0","iconv-lite":"^0.4.13","lodash":"^4.16.1","mkdirp":"^0.5.1","rimraf":"^2.1.4"},"devDependencies":{"chai":"^3.4.0","mocha":"^2.3.3","tmp":"0.0.28"},"_id":"fs-sync@1.0.7","gitHead":"55922a613976fcc352d526bbd9cd2603eb944f36","homepage":"https://github.com/kaelzhang/node-fs-sync#readme","_nodeVersion":"22.8.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-LWbVjxoDd4SSHR4/64xta+K/TuDk1Va8w/8+wDPfe/VZlvKX5hVJynadJnBK1Mt9c6pmhxC1iWD6afiy4iSvow==","shasum":"9bf91385fd47e0f219ddab2c5017d9155d6ee406","tarball":"http://registry-npm.ywwl.com/fs-sync/download/fs-sync-1.0.7.tgz","fileCount":4,"unpackedSize":10652,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNk2Nbpw+Qv5t+J9aqzZJ7jp0SUYcLnR+tmj4HBZRxaQIgK1SOvkZAsmHeT0d3PzJ4cy+xcBLPqtZEw9089zIIwTc="}],"size":4185,"noattachment":false,"key":"/fs-sync/-/fs-sync-1.0.7.tgz"},"_npmUser":{"name":"kael","email":"i@kael.me"},"directories":{},"maintainers":[{"name":"kael","email":"i@kael.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fs-sync_1.0.7_1755152106974_0.10128299831879528"},"_hasShrinkwrap":false,"readme":"Maintenance for this project has been discontinued in favor of using [fs-extra](https://www.npmjs.com/package/fs-extra)\n\n----\n\n[![Build Status](https://travis-ci.org/kaelzhang/node-fs-sync.png?branch=master)](https://travis-ci.org/kaelzhang/node-fs-sync)\n\n# fs-sync\n\n> Synchronous fs with more fun\n\n## Getting Started\nThis module is created for the favor of use of `fs.xxxSync`.\n\nOnce `fs-sync` is installed, you can use:\n\n```js\nvar fs = require('fs-sync');\n\nif(fs.exists('package.json')){\n\tvar pkg = fs.readJSON('package.json');\n}\n```\n\n## Methods\n\n```js\nvar fs = require('fs-sync');\n```\n\n### fs.defaultEncoding\nType: `String`\n\nDefault value: `'utf-8'`\n\nGlobal default encoding\n\n```js\nfs.defaultEncoding = 'utf-8'\n```\n\n### fs.copy(from, to, options)\n\nCopy a file or a whole directory to the destination. During this, necessary directories will be created.\n\n#### Syntax\n\n```js\nfs.copy(file, destpath, options);\nfs.copy(dir, destpath, options);\n```\n\n#### file\nType: `String`\n\nPath of file to be copied\n\n#### dir\nType: `String`\n\nPath of directory to be copied\n\n#### options.force\nType: `Boolean`\n\nDefault value: `false`\n\nBy default, `fs.copy` will not override existed files, set `options.force` as `true` to override.\n\n\n### fs.mkdir(path)\n\nCommandline `mkdir` or `mkdir -p`\n\n\n### fs.expand(patterns, options)\n\nLike `grunt.file.expand`, but the sequence of the arguments is different\n\n\n### fs.write(file, content, options)\n\n#### options\nType: `Object`\n\nThe same as the `options` argument of [fs.writeFile](http://nodejs.org/api/fs.html#fs_fs_writefile_filename_data_options_callback)\n\n### fs.read(file, options)\nRead a file\n\n#### options\nType: `Object`\n\nThe same as the `options` argument of [fs.writeFile](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback), except:\n\n#### options.encoding\nType: `String`\n\nDefault value: `fs.defaultEncoding`\n\n### fs.readJSON(file, options)\nRead a file as the JSON format, if the file content fails to be parsed as JSON, an error will be thrown.\n\n### fs.remove()\n\nDelete a file or a whole directory. It's a dangerous action, be careful.\n\nEquivalent to `rm -rf`(remove a folder and all its contents) or `rm -f`(unlink a file)\n\n#### Syntax\n\n```js\nfs.remove(file)\nfs.remove(dir)\n```\n\n### fs.exists(...)\n\n`arguments` will be called with `path.join`\n\n### fs.isDir(path)\n\n### fs.isFile(path)\n\n### fs.isLink(path)\n\n### fs.isPathAbsolute(path)\n\n#### Returns `Boolean`\n\nWhether the given `path` is an absolute path (starting with `'/'`)\n\n### fs.doesPathContain(ancestor, path...)\n\n```js\nif(fs.doesPathContain(ancestor, path, path2)){\n\tconsole.log(path, 'and', path2, 'are inside', ancestor);\n}\n```\n\n#### Returns `Boolean`\n\nWhether path `ancestor` contains all `path`s after\n\n#### ancestor `String`\n\nAncestor path\n\n#### path `String`\n\nThe arguments of `fs.doesPathContain` could be more than 2.\n\n\n\n\n\n","publish_time":1755152107156,"_cnpm_publish_time":1755152107156,"dist-tags":{"latest":"1.0.7"}}