New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

render-in-place

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

render-in-place

Render an ejs templated file

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

🎞 render-in-place

Render an ejs templated file, overwriting it with the result.

Usage

Import

This module exposes a function as its default export.

CommonJS

const render = require('render-in-place').default;

render(...)

TypeScript

With allowSyntheticDefaultImports

import render from 'render-inplace';

render(...)

Without allowSyntheticDefaultImports

import { default as render } from 'render-in-place';

render(...)

// or

import * as rip from 'render-in-place';

rip.render(...)

Example

import render from 'render-in-place';

render(
    '/path/to/template', // path to template file
    { data: { to: 'render' } }, // data passed to template
    {
        read: {}, // config passed to ejs reading file
        write: {}, // config passed to fs when writing file
    },
)

Documentation

render(path: string, data: object, config: object)

path

The absolute path to your template file.

data

Any data to pass off to the template when rendering. This value is provided directly to ejs when rendering your file.

config

Extra configuration provided to ejs.renderFile or fs.writeFile.

config.read

Configuration passed to ejs.renderFile.

config.write

Configuration passed to fs.writeFile.

FAQs

Package last updated on 17 Jun 2018

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