Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anthonyshort/component-string
Component(1) plugin to allow you to require any file as a string
https://github.com/anthonyshort/component-string
Last synced: 24 days ago
JSON representation
Component(1) plugin to allow you to require any file as a string
- Host: GitHub
- URL: https://github.com/anthonyshort/component-string
- Owner: anthonyshort
- Created: 2013-02-17T10:46:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-24T22:31:03.000Z (about 11 years ago)
- Last Synced: 2024-04-15T03:16:20.048Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 60.5 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### This plugin isn't needed with Component 0.17+. Use the templates section of your component.json file and you can automatically require the files.
# component-string
Component plugin to allow you require files as strings.
## Installation
```
npm install component-string
```## Usage
```
component build --use component-string
```Add a `strings` section to your `component.json`
```
{
"name": "foo",
"scripts": ["index.js"],
"strings": ["template.html"]
}
```Now in your `index.js` file you can require it:
```
var template = require('./template.html');
```