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

mytemplatertest

v1.1.2

Published

This project is a template to show how to create a customized version of **[apigee-templater](https://github.com/apigee/apigee-templater)**. This template has a custom API key validation plugin in `./lib/auth.apikey.plugin.ts`, which is replaces the defau

Downloads

8

Readme

apigee-templater-custom

This project is a template to show how to create a customized version of apigee-templater. This template has a custom API key validation plugin in ./lib/auth.apikey.plugin.ts, which is replaces the default API key validation plugin in apigee-templater.

Getting started

To get started, clone this repository and install dependencies.

# Clone this repository
git clone https://github.com/apigee/apigee-templater-custom.git
cd apigee-templater-custom
npm install

Then run the unit tests to see how the customized version of apigee-templater is used with a custom plugin for API key validation.

# Run the unit tests
npm run build
npm run test

You should have a subdirectory under ./test/proxies with a generated proxy, included the extracted proxy bundle. As you can see in ./test/data/input1.json, the input was a simple configuration for a proxy to https://httpbin.org with custom API key validation.

The unit tests in ./test/data/convert.text.ts verify that the generated proxy file exists, and that the expected files and contents are included in the generated proxy bundle.

Customizing

The file ./bin/mytemplater.js shows you how you can create your own CLI tool with your own customized plugins. This example has a customized API key validation plugin in ./lib/auth.apikey.plugin.ts.

Testing

You can easily test your CLI by just running the mytemplater.js class using node.

# Run the CLI
npm run build
cd ./bin
node mytemplater.js

You should get the default functionality of apigee-templater, but with your custom plugins applied.

$ node mytemplater.js
> Welcome to Apigee Templater, use -h for more command line options. 
? What should the proxy be called? MyProxy
? Which base path should be used? /test
? Which backend target URL should be called? https://httpbin.org
? Do you want to deploy the proxy to an Apigee X environment? No
> Proxy MyProxy generated to ./MyProxy.zip in 129 milliseconds.

You can also test your CLI locally on your system by just linking the module, and then using the command

# Go to the project root
npm link

# Then anywhere on your system you can use the CLI
mytemplater -h

## If you want to remove it, unlink the global package
npm uninstall --global mytemplater

Publishing

To publish your CLI, simply change the name and details in package.json and run npm publish.