Socket
Socket
Sign inDemoInstall

raw-loader

Package Overview
Dependencies
Maintainers
7
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raw-loader - npm Package Compare versions

Comparing version 0.5.1 to 1.0.0-beta.0

.gitattributes

6

index.js

@@ -8,4 +8,6 @@ /*

this.value = content;
return "module.exports = " + JSON.stringify(content);
content = JSON.stringify(content)
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029');
return "export default " + content;
}
module.exports.seperable = true;
{
"name": "raw-loader",
"version": "0.5.1",
"author": "Tobias Koppers @sokra",
"description": "raw loader module for webpack",
"repository": {
"type": "git",
"url": "git@github.com:webpack/raw-loader.git"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
]
"name": "raw-loader",
"version": "1.0.0-beta.0",
"author": "Tobias Koppers @sokra",
"description": "raw loader module for webpack",
"main": "index.js",
"license": "MIT",
"scripts": {
"release": "standard-version"
},
"devDependencies": {
"standard-version": "^4.2.0"
},
"repository": {
"type": "git",
"url": "git@github.com:webpack/raw-loader.git"
}
}

@@ -1,15 +0,109 @@

# raw loader for webpack
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![chat][chat]][chat-url]
## Usage
<div align="center">
<img width="200" height="200"
src="https://cdn3.iconfinder.com/data/icons/lexter-flat-colorfull-file-formats/56/raw-256.png">
<a href="https://github.com/webpack/webpack">
<img width="200" height="200"
src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<h1>Raw Loader</h1>
<p>A loader for webpack that lets you import files as a string.</p>
</div>
``` javascript
var fileContent = require("raw!./file.txt");
// => returns file.txt content as string
<h2 align="center">Install</h2>
```bash
npm install --save-dev raw-loader
```
Don't forget to polyfill `require` if you want to use it in node.
See `webpack` documentation.
<h2 align="center">Usage</h2>
## License
Use the loader either via your webpack config, CLI or inline.
MIT (http://www.opensource.org/licenses/mit-license.php)
### Via webpack config (recommended)
**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.txt$/,
use: 'raw-loader'
}
]
}
}
```
**In your application**
```js
import txt from './file.txt';
```
### CLI
```bash
webpack --module-bind 'txt=raw-loader'
```
**In your application**
```js
import txt from 'file.txt';
```
### Inline
**In your application**
```js
import txt from 'raw-loader!./file.txt';
```
<h2 align="center">Maintainers</h2>
<table>
<tbody>
<tr>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150">
</br>
<a href="https://github.com/bebraw">Juho Vepsäläinen</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150">
</br>
<a href="https://github.com/d3viant0ne">Joshua Wiens</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/533616?v=3&s=150">
</br>
<a href="https://github.com/SpaceK33z">Kees Kluskens</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/3408176?v=3&s=150">
</br>
<a href="https://github.com/TheLarkInn">Sean Larkin</a>
</td>
</tr>
<tbody>
</table>
[npm]: https://img.shields.io/npm/v/raw-loader.svg
[npm-url]: https://npmjs.com/package/raw-loader
[node]: https://img.shields.io/node/v/raw-loader.svg
[node-url]: https://nodejs.org
[deps]: https://david-dm.org/webpack/raw-loader.svg
[deps-url]: https://david-dm.org/webpack/raw-loader
[chat]: https://badges.gitter.im/webpack/webpack.svg
[chat-url]: https://gitter.im/webpack/webpack
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc