Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
@cicara/vite-plugin-yaml
Advanced tools
Readme
Transforms a YAML file into a JS object.
npm install -D @modyfi/vite-plugin-yaml
# or
# yarn add -D @modyfi/vite-plugin-yaml
# or
# pnpm i -D @modyfi/vite-plugin-yaml
Add ViteYAML
to vite.config.js / vite.config.ts
:
// vite.config.js / vite.config.ts
import ViteYaml from '@modyfi/vite-plugin-yaml';
export default {
plugins: [
ViteYaml(), // you may configure the plugin by passing in an object with the options listed below
],
};
Then you can simply import yaml files like you would any other file:
import YamlContent from './your.yaml';
console.log(YamlContent.example);
Do note that you may have to include the file type in your import.
The recommended way to add type definitions for .yaml
or .yml
modules is via a tsconfig.json
file.
// tsconfig.json
{
"compilerOptions": {
...
"types": [
...
"@modyfi/vite-plugin-yaml/modules"
],
}
}
You may also add type definitions without tsconfig
:
// vite-env.d.ts
/// <reference types="@modyfi/vite-plugin-yaml/modules" />
/**
* A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on.
*
* By default all files are targeted.
*/
include?: FilterPattern;
/**
* A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore.
*
* By default no files are ignored.
*/
exclude?: FilterPattern;
/**
* Schema used to parse yaml files.
*
* @see https://github.com/nodeca/js-yaml/blob/49baadd52af887d2991e2c39a6639baa56d6c71b/README.md#load-string---options-
*/
schema?: Schema;
/**
* A function that will be called for error reporting.
*
* Defaults to `console.warn()`.
*/
onWarning?: (warning: YAMLException) => void;
FAQs
import yaml files as js objects
The npm package @cicara/vite-plugin-yaml receives a total of 2 weekly downloads. As such, @cicara/vite-plugin-yaml popularity was classified as not popular.
We found that @cicara/vite-plugin-yaml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.