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

linkparam

v1.2.1

Published

Evaluate the Link/URL parameter submitted to an HTML-file. This is in general used by scripts on a server that receives content by submitting HTML form content to the server. The package LinkParam can evaluate these parameters and use the values in genera

Downloads

9

Readme

Javascript Class: LinkParam

created Javascript Class Creator JSCC 2017/11/14 11:37:47

https://niebert.github.io/JavascriptClassCreator

File: js/linkparam.js

Demo LinkParam: https://niebert.github.io/LinkParam/index.html

The file index.html sends the values via the Link Parameter.

The demo works cross-origine. You can submit a parameter cross-origine to the file receiver.html. Copy index.html to your hard drive and press the submit button.

Examples:

  • https://niebert.github.io/LinkParam/receiver.html?myparam=TestValue
  • https://niebert.github.io/LinkParam/receiver.html?myparam=Test&count=460

NPM Module: https://www.npmjs.com/package/linkparam

UML

NPM Build

The part of build process is defined by build.js and the chain of code generation can be executed with

npm run build

NPM installation

Installation with NPM and save the package to your dependencies (i.e. add entry linkparam as package in your package.json) with npm install linkparam --save Assume you will use this package in your NodeJS application my_web_app with the main file index.js. With the command above any other user, that installs your package my_web_app will install linkparam as well due to the dependency of my_web_app with the library linkparam.js. When you want to replace the package linkparam with another NPM package, edit your package.json and remove linkparam from the dependencies.

Javascript Class: LinkParam

created Javascript Class Creator JSCC 2017/12/27 9:30:40 https://niebert.github.io/JavascriptClassCreator File: js/linkparam.js

Attributes: LinkParam

size:Integer

  • Default value: 0
  • Visibility: public
  • Comment: Counts the Number of Parameter

aVars:Hash

  • Default value: {}
  • Visibility: public
  • Comment: Attribute: 'aVars' Type: 'Hash' stores all URL parameters

aLink:String

  • Default value: ""
  • Visibility: public
  • Comment: Attribute: 'aLink' Type: 'String' stores the Link before '?'

Methods: LinkParam

init(pDoc:Document)

  • Visibility: public init extract the link with parameters from document.location.search and store aLink)

parseURL(pLink:String):String

  • Return Type: String
  • Visibility: public parses the URL stores the variables in 'aVar' e.g. ..&lastname=Niehaus&... stores aVars['name']='Niehaus')String

getURL(pVarHash:Hash):String

  • Return Type: String
  • Visibility: public Comment for getLink)String

setValue(pVar:String,pValue:String)

  • Visibility: public Comment for setValue)

getValue(pVar:String):String

  • Return Type: String
  • Visibility: public Comment for getValue(pVar) return the definition of the parameter exists otherwise en empty string)String

deleteValue(pVar:String)

  • Visibility: public Comment for deleteValue in the parameter hash aVars return a Boolean if delete was sucessful, resp. variable pVar exists in Hash aVars)

getLink4URL():String

  • Return Type: String
  • Visibility: public get the Link part of the URL without the URL parameters)String

getParam4URL():String

  • Return Type: String
  • Visibility: public get the parameter string for the URL starting with ? if aVars contains variables)String

decodeParam(pParam:String):String

  • Return Type: String
  • Visibility: public decode a parameter from the URL)String

encodeParam(pParam:String)

  • Visibility: public encode a parameter for a call from the app.)

getTableHTML():String

  • Return Type: String
  • Visibility: public creates a HTML table with two column for key and value of the parameter hash aVars)String

getEditTableHTML(pPrefixID:String):String

  • Return Type: String
  • Visibility: public creates a Edit HTML table with two column for key and value of the parameter hash aVars. The keys of aVars are used as IDs for the HTML form. An optional ID prefix as parameter can be used to create a unique ID for the DOM elements All parameters are visible in an input field.)String

calcSize()

  • Visibility: public calculates the number of variables defined in the URL parameters, stores result in length)

encodeHTML(pValue:String,pWrapCode:Boolean):String

  • Return Type: String
  • Visibility: public Encodes source code for HTML-Output in as code or textarea in the following way:
  1. Replace "&" character with "&"
  2. Replace "<" character with "&lt;"
  3. Replace ">" character with "&gt;" The converted pValue will wrapped with pre and code tags for direct display as HTML and without code tag wrapper if the code is written as inner HTML and value to a textarea.)
  • Return: String

exists(pVar:String):Boolean

  • Return Type: Boolean
  • Visibility: public checks if the parameter with variable 'pVar' exists in parameter hash this.aVars)Boolean