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

trm

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trm

tracking management client code

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

#TRM

Build Status

Tracking management client javascript code for Hiiir Ads platform

##usage

npm install trm

Generate library

Trm is a tracking code for PMD platform, you can generate a new library in your localhost.

trm = require("trm")
// will generate a library in `./tmp/test.js`
result = trm.generateLib({
  domain: "yahoo.com.tw",
  destPath: "./tmp/test.js"
})

// code reulst
console.log(result.code);

result.then(function (result) {
  // show file content and save data in destination path
  console.log(result);
})

##client usage

call trm and import code that is from trm source.

  //code is from compressed
  out = trm.compress();
  trm.resultDisplay({
    code: out.code,
    pid: pixel id,
    aid: audience id
  });

##Client code output,

That is output code from trm.resultDisplay()

  !function(){return window.analytics={load:function(t){var n,e,o;document.getElementById("analytics-js")||(n=document.createElement("script"),n.type="text/javascript",n.id="analytics-js",n.async=!0,n.src=("https:"===document.location.protocol?"https://":"http://")+"localhost:8080/.tmp/test.js",o=document.getElementsByTagName("script")[0],o.parentNode.insertBefore(n,o)),e=window.onload,window.onload=function(){return e&&e(),t()}},VERSION:"0.1.3"}}();
  window.analytics.load(function () {
    window.analytics.initial("-999", "-99999");
    window.analytics.send("");
  });

    window.analytics.load(function () {
      window.analytics.initial("1", "--FB-Audience-ID--");
      window.analytics.push("id", "abc");
      window.analytics.push("NTD", "168");
      window.analytics.send("");
    });

TODO

  • client side auto test

##Ref

FAQs

Package last updated on 29 Apr 2015

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