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

getto-detect

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getto-detect

javascript function for static web to detect next version's path

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

getto-detect

javascript function for static web to detect next version's path

GettoDetect().from_current_version("1.0.0", function(path) {
  path // => "/2.1.0/index.html" (e.g.)

  // redirect to next version
  location.href = path
});
  • request to HEAD /1.0.1/index.html, HEAD /1.1.0/index.html, HEAD /2.0.0/index.html
  • if response status is 200, re-check (1) with next version
  • finally, callback with (2) path
  • version number must follow semantic version rule
Table of Contents
  • Usage
  • License

Usage

Install

npm install --save-dev getto-detect
cp node_modules/getto-detect/dist/getto-detect.js /path/to/your/project

or

curl https://github.com/getto-systems/getto-detect/blob/master/dist/getto-detect.js -o /path/to/your/project/getto-detect.js

from_current_version

GettoDetect().from_current_version(
  "1.0.0", // the version to start detecting
  function(path) {
    // detected
  },
  function() {
    // not found
  }
);

detect next version's path from current version

options

version_to_path

GettoDetect({
  // function that convert from version number to path
  version_to_path: function(version) {
    return "/" + version + "/index.html";
  },
})

specify function that convert from version number to path

License

getto-detect is licensed under the MIT license.

Copyright © since 2018 shun@getto.systems

FAQs

Package last updated on 26 Sep 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