Socket
Socket
Sign inDemoInstall

require-text

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    require-text

require() text files


Version published
Weekly downloads
3.1K
decreased by-18.2%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

require-text

require() text files

  • Overview
  • Installation
  • API
  • 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:

$ 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

Keywords

FAQs

Last updated on 20 Aug 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc