require-text
require() text files
Last updated 6 years ago by jakutis .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install require-text 
SYNC missed versions from official npm registry.

require-text

require() text files

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:

$ npm install --save require-text

API

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

Current Tags

  • 0.0.1                                ...           latest (6 years ago)

1 Versions

  • 0.0.1                                ...           6 years ago

Copyright 2014 - 2017 © taobao.org |