Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@modyfi/vite-plugin-yaml

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modyfi/vite-plugin-yaml - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

dist/index.d.cts

8

dist/index.d.ts

@@ -27,2 +27,8 @@ import { Schema, YAMLException } from 'js-yaml';

/**
* A boolean to determine if JSON object should be serialized.
*
* @see https://www.npmjs.com/package/tosource for the motivation behind serialization of JSON.
*/
raw?: boolean;
/**
* A function that will be called for error reporting.

@@ -39,2 +45,2 @@ *

export { PluginOptions, _default as default };
export { type PluginOptions, _default as default };

2

dist/index.js

@@ -20,3 +20,3 @@ // src/index.ts

return {
code: `const data = ${toSource(yamlData)};
code: `const data = ${options.raw ? yamlData : toSource(yamlData)};
export default data;`,

@@ -23,0 +23,0 @@ map: { mappings: "" }

{
"name": "@modyfi/vite-plugin-yaml",
"version": "1.0.4",
"version": "1.1.0",
"description": "Import YAML files as JS objects 🔌",

@@ -12,2 +12,8 @@ "type": "module",

"license": "MIT",
"scripts": {
"dev": "tsup --watch src",
"example:dev": "pnpm -C example run dev",
"example:build": "pnpm run build && pnpm -C example run build",
"build": "tsup"
},
"exports": {

@@ -46,6 +52,6 @@ ".": {

"peerDependencies": {
"vite": "^2.6.0 || ^3.0.0 || ^4.0.0"
"vite": "^3.2.7 || ^4.0.5 || ^5.0.5"
},
"dependencies": {
"@rollup/pluginutils": "5.0.2",
"@rollup/pluginutils": "5.1.0",
"js-yaml": "4.1.0",

@@ -55,14 +61,8 @@ "tosource": "2.0.0-alpha.3"

"devDependencies": {
"@types/js-yaml": "4.0.5",
"c8": "7.12.0",
"tsup": "6.5.0",
"typescript": "4.9.4",
"vite": "4.0.3"
},
"scripts": {
"dev": "tsup --watch src",
"example:dev": "pnpm -C example run dev",
"example:build": "pnpm run build && pnpm -C example run build",
"build": "tsup"
"@types/js-yaml": "4.0.9",
"c8": "8.0.1",
"tsup": "8.0.1",
"typescript": "5.3.3",
"vite": "5.0.10"
}
}
}

@@ -32,2 +32,12 @@ [![Pipeline](https://github.com/Modyfi/vite-plugin-yaml/actions/workflows/pipeline.yml/badge.svg)](https://github.com/Modyfi/vite-plugin-yaml/actions/workflows/pipeline.yml)

Then you can simply import yaml files like you would any other file:
```ts
import YamlContent from './your.yaml';
console.log(YamlContent.example);
```
Do note that you may have to include the file type in your import.
### 🔦 TypeScript support

@@ -79,2 +89,8 @@

/**
* A boolean to determine if JSON object should be serialized.
*
* @see https://www.npmjs.com/package/tosource for the motivation behind serialization of JSON.
*/
raw?: boolean;
/**
* A function that will be called for error reporting.

@@ -81,0 +97,0 @@ *

Sorry, the diff of this file is not supported yet

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