npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

html_resolve

v1.1.2

Published

This is a package for importing the contents of a file while replacing parts of it specified values

Downloads

5

Readme

html_resolve

Node module to help with importing non-static html

Named after the older form of long distant communication before telephones and email. Represents the ability to send a message to anyone you want to

API

const resolve = require("html_resolve");

const resolve_absolute = resolve.absolute;

const resolve_relative = resolve.relative(__dirname);

html_resolve(file, data, silent?)

Returns a string representing the contents of file file with all the data hooks contained replaced with the corresponding data in data.

Use resolve_absolute when passing in a absolute path and resolve_relative for relative paths.

file is a String representing the file path. Both relative and absolute paths work. Though this is intended to be an html file, this is not restricted so that this can be used with any markup file format.

data is a Object that matches data hook names to data. The value will have toString() called on it.

silent is a Boolean that makes hooks that do not exist in data fail silently and are just removed from the outputted file.

The data hook format is the follow: {hook_name} anyway within the given file will be replace with data_val if the following data object is provided:

{
    "hook_name": "data_val"
}

data may contain more hooks then required but if a hook does not exist in data then a Error: hook not found error will be thrown.

To escape the matching place a \ in front of the {{hook_name}}, like this: \{{hook}. The \ will be removed in the outputted text.

LICENSE

This package is licenced under MIT. (c) 2017