New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

yaml-loader

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-loader - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

2

index.js

@@ -6,3 +6,3 @@ var yaml = require('js-yaml');

var res = yaml.safeLoad(source);
return 'module.exports = ' + JSON.stringify(res, undefined, '\t');
return JSON.stringify(res, undefined, '\t');
};
{
"name": "yaml-loader",
"version": "0.3.0",
"version": "0.4.0",
"description": "YAML loader for webpack (converts YAML to JSON)",

@@ -5,0 +5,0 @@ "main": "index.js",

# yaml-loader for webpack
YAML loader for [webpack](http://webpack.github.io/). Converts YAML to JSON.
YAML loader for [webpack](http://webpack.github.io/). Converts YAML to a valid JSON. If you want a JS Object, chain it with [json-loader](https://github.com/webpack/json-loader).

@@ -13,7 +13,34 @@ ## Installation

Simplest case would be:
``` javascript
var json = require("yaml!./file.yml");
var json = require("json!yaml!./file.yml");
// => returns file.yml as javascript object
```
This loader is also useful for getting a valid JSON from YML. For example:
```js
// webpack.config.js
module: {
loaders: [
{
test: /\.yaml$/,
include: path.resolve('data'),
loader: 'yaml',
},
],
}
```
and then
```js
// applicatin.js
const actualFilename = require(`file?name=[name].json!./../data/${file}.yaml`);
window.fetch(actualFilename).then(res => {
// ...
});
```
## License

@@ -20,0 +47,0 @@

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