Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakutis/require-text
require() text files
https://github.com/jakutis/require-text
Last synced: 3 months ago
JSON representation
require() text files
- Host: GitHub
- URL: https://github.com/jakutis/require-text
- Owner: jakutis
- License: mit
- Created: 2014-08-20T12:46:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-20T13:02:01.000Z (over 10 years ago)
- Last Synced: 2024-10-03T07:16:00.843Z (4 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.org/package/require-text
- Size: 125 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# require-text
require() text files
- [Overview](#overview)
- [Installation](#installation)
- [API](#api)
- [Development](#development)## Overview
* Useful in Node.JS environment, which can only require .js, .json and .node files.
* Resolves and loads the file from filename just like the standard Node.JS require - does relative path resolution, etc.## Installation
Install with [npm](https://www.npmjs.org/package/require-text):
$ npm install --save require-text
## API
```javascript
var requireText = require('require-text');var index = requireText('./index.html', require);
// Prints contents of ./index.html file, which resides
// in the same directory as this source code file.
console.log(index);
```## Development
#### Checklist before releasing
* package.json version number bumped
* `release X.X.X` commit created and tagged as `X.X.X`
* `npm publish`