{"_id":"read-file-relative","_rev":"8-329e4c05d82c38ea6b67a113c4d0aee2","name":"read-file-relative","description":"Read files with path relative to the current module without annoying boilerplate code ","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"read-file-relative","version":"1.0.0","description":"Read files with path relative to the current module without annoying boilerplate code ","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/inikulin/read-file-relative"},"keywords":["read","file","relative","path"],"author":{"name":"Ivan Nikulin","url":"ifaaan@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/inikulin/read-file-relative/issues"},"homepage":"https://github.com/inikulin/read-file-relative","files":["index.js"],"devDependencies":{"mocha":"^2.3.3"},"dependencies":{"callsite":"^1.0.0"},"gitHead":"c641c05675c627d8218b98ade55a5a0a042bd4e9","_id":"read-file-relative@1.0.0","_shasum":"eb4a532b58a380dad5c64e3aba172c9c79c2e2de","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"dist":{"shasum":"eb4a532b58a380dad5c64e3aba172c9c79c2e2de","tarball":"https://registry.npmjs.org/read-file-relative/-/read-file-relative-1.0.0.tgz","integrity":"sha512-9jkeDWgpr5Ob2TzEevINjzSkOCD7kCaGEAHzMojcVayELNofiLY0ADuFpWX2Z0AAwOmyAk62I4sGR9ZN1nlPgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpIfKjZ/i8gbwoOkVHkJP69dwlGazlTds0KyMZwrH/ngIgc+0qsc0TzP7MkQamLVz8HjqBzscHQe5pe9/FdWDokjI="}]},"directories":{}},"1.0.1":{"name":"read-file-relative","version":"1.0.1","description":"Read files with path relative to the current module without annoying boilerplate code ","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/inikulin/read-file-relative"},"keywords":["read","file","relative","path"],"author":{"name":"Ivan Nikulin","url":"ifaaan@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/inikulin/read-file-relative/issues"},"homepage":"https://github.com/inikulin/read-file-relative","files":["index.js"],"devDependencies":{"mocha":"^2.3.3"},"dependencies":{"callsite":"^1.0.0"},"gitHead":"8d201ff791ac42173c611d563f8b960bef99c74f","_id":"read-file-relative@1.0.1","_shasum":"27f0aeec9b6d470d0dbb83b988d937aad3820702","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"dist":{"shasum":"27f0aeec9b6d470d0dbb83b988d937aad3820702","tarball":"https://registry.npmjs.org/read-file-relative/-/read-file-relative-1.0.1.tgz","integrity":"sha512-b612CCndfBfEq3agNPoywvZ/mw3rdk9GYFdunuf1LU/i8wwwak1wkWf5WeLw2jCHyYWafKHUXs4W35j8UQWhyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnm9KjhNz0AxNscgUfS+ptmLnZ4ikidT1IsATzH0aPWwIgEBhvOQH3P1dGdbsoEHV8MxxpHBtigDUf27Tf+9WKqVI="}]},"directories":{}},"1.1.0":{"name":"read-file-relative","version":"1.1.0","description":"Read files with path relative to the current module without annoying boilerplate code ","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/inikulin/read-file-relative.git"},"keywords":["read","file","relative","path"],"author":{"name":"Ivan Nikulin","url":"ifaaan@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/inikulin/read-file-relative/issues"},"homepage":"https://github.com/inikulin/read-file-relative","files":["index.js"],"devDependencies":{"mocha":"^2.3.3"},"dependencies":{"callsite":"^1.0.0"},"gitHead":"07a3d6a1e01b7fcd1cfdc921efe633c617eb1ffd","_id":"read-file-relative@1.1.0","_shasum":"f9bb046f62ce1187873ec3215b60e4b2da929a98","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"dist":{"shasum":"f9bb046f62ce1187873ec3215b60e4b2da929a98","tarball":"https://registry.npmjs.org/read-file-relative/-/read-file-relative-1.1.0.tgz","integrity":"sha512-T45lvxwPAQ/Q9NOyDKBMvxyEYHZbJIj5V5pRsIY+jRUurqjJWt4aYL7aExwb//5gNE3/fnO0VvLk5y9zoA2dfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFE+E4yNBrDUU6/1XqBl3pyzI6uhqV6yhEp/1xr5b66hAiBz7MJTFW38g8kdjtXsu+tG22zVsqjef2MEF/gbI/MILA=="}]},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"directories":{}},"1.2.0":{"name":"read-file-relative","version":"1.2.0","description":"Read files with path relative to the current module without annoying boilerplate code ","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/inikulin/read-file-relative"},"keywords":["read","file","relative","path"],"author":{"name":"Ivan Nikulin","url":"ifaaan@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/inikulin/read-file-relative/issues"},"homepage":"https://github.com/inikulin/read-file-relative","files":["index.js"],"devDependencies":{"mocha":"^2.3.3"},"dependencies":{"callsite":"^1.0.0"},"gitHead":"69a0c7d529559c9ca66dee4a2b78daa073f372bb","_id":"read-file-relative@1.2.0","_shasum":"98f7d96eaa21d2b4c7a2febd63d2fc8cf35e9f9b","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"inikulin","email":"ifaaan@gmail.com"},"maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"dist":{"shasum":"98f7d96eaa21d2b4c7a2febd63d2fc8cf35e9f9b","tarball":"https://registry.npmjs.org/read-file-relative/-/read-file-relative-1.2.0.tgz","integrity":"sha512-lwZUlN2tQyPa62/XmVtX1MeNLVutlRWwqvclWU8YpOCgjKdhg2zyNkeFjy7Rnjo3txhKCy5FGgAi+vx59gvkYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPn2vmJd5meuDUVlK6e/4OJhQi4noZwHvGvV1EJYnZ+AiB4cwtH5stAXqGipjKbK5RwlUsQaPCipDAQqZvP/oeYAA=="}]},"directories":{}}},"readme":"# read-file-relative\n[![Build Status](https://api.travis-ci.org/inikulin/read-file-relative.svg)](https://travis-ci.org/inikulin/read-file-relative)\n\n*Read files with path relative to the current module without annoying boilerplate code*\n\n~~Well, I've expected @sindresorhus has a module for this, but he didn't.~~\n\n## What's going on?\n\nIf you have code like this:\n```js\nvar fs   = require('fs');\nvar path = require('path');\n\nvar data = fs.readFileSync(path.join(__dirname, '/my-awesome-file')).toString();\n```\n\nNow you can replace it with:\n```js\nvar readSync = require('read-file-relative').readSync;\n\nvar data = readSync('/my-awesome-file');\n```\n\nThat's it.\n\nYou want a plain buffer instead of string? No problem - just use optional second argument:\n```js\nvar readSync = require('read-file-relative').readSync;\n\nvar buffer = readSync('/my-awesome-file', true);\n```\n\nYou like it the async way (didn't you :wink:)? Do it this way:\n```js\nvar read = require('read-file-relative').read;\n\nread('/my-awesome-file', function(err, content) {\n   ...\n});\n```\n\nYou can pass options or encoding like for regular `fs.readFile`:\n```js\nvar read = require('read-file-relative').read;\n\nread('/my-awesome-file', 'utf8', function(err, content) {\n   ...\n});\n```\n\nBTW, you can just convert given path to absolute:\n```js\nvar toAbsPath = require('read-file-relative').toAbsPath;\n\nvar absPath = toAbsPath('/my-awesome-file');\n```\n\n## Install\n```\nnpm install read-file-relative\n```\n\n## Author\n[Ivan Nikulin](https://github.com/inikulin) (ifaaan@gmail.com)\n","maintainers":[{"name":"inikulin","email":"ifaaan@gmail.com"}],"time":{"modified":"2022-06-26T09:13:26.503Z","created":"2015-10-05T21:26:40.652Z","1.0.0":"2015-10-05T21:26:40.652Z","1.0.1":"2015-10-05T21:28:15.016Z","1.1.0":"2015-10-06T09:58:44.379Z","1.2.0":"2015-10-06T19:36:05.179Z"},"homepage":"https://github.com/inikulin/read-file-relative","keywords":["read","file","relative","path"],"repository":{"type":"git","url":"https://github.com/inikulin/read-file-relative"},"author":{"name":"Ivan Nikulin","url":"ifaaan@gmail.com"},"bugs":{"url":"https://github.com/inikulin/read-file-relative/issues"},"license":"MIT","readmeFilename":"README.md","users":{"masterde":true,"maxorelus":true}}