Socket
Socket
Sign inDemoInstall

yml-register

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

yml-register


Version published
Weekly downloads
545
decreased by-17.3%
Maintainers
1
Install size
571 kB
Created
Weekly downloads
 

Readme

Source

yml-register

downloads npm GitHub

Hooks into require / import to load .yaml and .yml files.

Usage

From CLI

CJS:

node -r yml-register path/to/index.cjs

ESM (Node.js 20.6.0 or later):

node --import yml-register path/to/index.mjs

Manually import

CJS:

require('yml-register')
require('path/to/file.yml') // now it works!

ESM:

import 'yml-register'
const data = await import('path/to/file.yml') // now it works!

TypeScript support

In order to fixing the error Cannot find module 'file.yml' or its corresponding type declarations. when using import statement in TypeScript, we provides a type declaration bundled in this package.

What you need is to append compilerOptions.types by yml-register/types in tsconfig.json.

{
  "compilerOptions": {
    "types": [
      "yml-register/types",
    ],
  },
}

Keywords

FAQs

Last updated on 16 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc