Socket
Book a DemoInstallSign in
Socket

pear-stamp

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pear-stamp

Pear template transforms

latest
npmnpm
Version
1.0.2
Version published
Maintainers
2
Created
Source

pear-stamp

Pear template transforms

API

Placeholder Syntax: __name__, allowed: [a-zA-Z/\\.:]*.

stamp.sync(template, locals[, shave])

Interleaves template parts with locals[name]. Expectes sanitized/escaped inputs.

Returns string.

  • template: string containing placeholders
  • locals: { [name: string]: any } interpolation values
  • shave : { [name: string]: [before: number, after: number] }

stamp.stream(template, locals[, shave])

Interleaves template parts with value-expanded locals[name]. Value-expansion includes promise-resolving and streams. A promise local will have it's resolved value inlined into the the template where the local is declared. A stream local will like-wise render inline.

Returns streamx.Readable (objectMode: true).

  • template: string containing placeholders
  • locals: { [name: string]: any } interpolation values. Includes Promise and stream rendering.
  • shave : { [name: string]: [before: number, after: number] } slices per before & after for a given local value

License

Apache-2.0

FAQs

Package last updated on 02 Oct 2025

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