🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More β†’
Socket
Book a DemoSign in
Socket

@emdaer/plugin-import

Package Overview
Dependencies
Maintainers
4
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emdaer/plugin-import

An emdaer plugin that imports content from another file

Source
npmnpm
Version
3.2.30
Version published
Weekly downloads
297
212.63%
Maintainers
4
Weekly downloads
Β 
Created
Source

@emdaer/plugin-import Β· Travis Documented with emdaer Maintained with lerna

An emdaer plugin that imports content from another file

Usage

@emdaer/plugin-import is an emdaer plugin – see the emdaer monorepo for more information

Documentation

Example

Import a plain markdown file like so:
This content was imported!

Import and call a function that returns/resolves a string like so: A function named printThrice is called with the string Hello world! x3:
Hello world! x3
Hello world! x3
Hello world! x3

Usage in README

<!--emdaer-p
  - '@emdaer/plugin-import'
  - path: .emdaer/importExample.md
    runEmdaer: true
-->
<!--emdaer-p
  - '@emdaer/plugin-import'
  - path: .emdaer/printThrice
    args:
      - Hello world! x3
-->

importPlugin

Import content into your readme Content can be imported in a few ways, as long as it’s a string

  • a local path to a markdown file, a partial of your readme. ex: .emdaer/README/USAGE.md.
  • a path to a node module that contains markdown files in its pacakge. ex: moduleName/lib/file.md.
  • a path to a node module exporting a string. ex: moduleName/lib/todo.js
  • a path to a node module exporting a function that takes arguments and returns/resolves to a string ex: module

Parameters

  • options any
    • options.path string? The filename to require.
    • options.args array? An array of args to pass to the exported function at the required path.
    • options.runEmdaer boolean? Whether or not to run emdaer on the content.

Examples

<!--emdaer-p
  - '@emdaer/plugin-import'
  - path: .emdaer/importExample.md
    runEmdaer: true
-->
<!--emdaer-p
  - '@emdaer/plugin-import'
  - path: .emdaer/printThrice
    args:
      - Hello world! x3
-->

Returns Promise<string> The contents at the path or the execution results

getMarkdownPaths

Gets a list of possible paths for the given file This may be a relative path, check that first, then check in node modules.

Parameters

  • filePath string
  • path string the node module or relative path to append to the possible directories.

Returns Array<string> list of possible paths for the given file

Keywords

emdaer-plugin

FAQs

Package last updated on 09 Apr 2020

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