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

loops-tools

v0.0.21

Published

loops api and all tools

Downloads

34

Readme

Loops Tools

Includes every thing the need to be included while developing loops web pages (web apps) author [email protected]

Quick Start

in your VUE app:

  ...
  import LoopsTools from 'loops-tools';
  

  ...
  Vue.use(LoopsTools);
  // or
  Vue.use(LoopsTools, { env: 'production' }); // for production env
  
  // production env will use production API URL and all production settings.
    

install params:

  • beginToForeground (when web page back to visible)
  • beginToBackground (when web page hide to back)
  • onDestroy (when web view begin to destroy)

wanna call an API?

  import { api, request } from 'loops-tools';
  
  // no uid & token param needed. will auto get params from **url param** 
  // **UNLESS** you manually pass it into the **params**. that will override the url params.
  request(api.topupReward, ${params})
  .then(res => {
    ... 
    // do every thing with your result.
  })  
  
  // or
  
  api.topupReward.request(${params})
  .then(res =>{
    ...
    // same here or different code styles.
  })

other tools:

  import { inapp, points } from 'loops-tools';
  
  // wanna inject a DI point?  
  inapp.di(points(${pointid}));
  
  // wanna open a app page?
  inapp.openAppPage(${pageName}});
  
  // wanna get other url params?
  import { utils } from 'loops-tools';
  
  const pageType = utils.getUrlParams('pageType');
  // multiple
  const { param1, param2 } = utils.getUrlParams('param1', param2);

pretty simple and all you need is focus on the page logic.

of course. if there are new APIs or features required. need to manually update the lib. but that also make this lib extensible and flexible.

Overview

Module structure:

utils,   // include all utils. lke get url param and find, filter functions.
request, // method to request APIs.  alias for utils.request. because frequently used 
inapp,   // in APP features. like DI, open APP page etc..
api,     // APIS. 
points,  // di points
VERSION, // tools version. can see the release log to decide if this tools include requeired features.

Utils Methods

utils.getUrlParams(paramName[s])

Argument

paramName (array of string, string) : the param names

Returns

string or object

Example

const something = utils.getUrlParams('something');

const { param1, param2 } = utils.getUrlParams(['param1', 'param2']);

utils.getMobileOperatingSystem()

Argument

Returns

enum['Windows Phone', 'Android', 'iOS', 'unknown']

Example

utils.getChromeVersion()

Argument

Returns

number of chrome version

Example

utils._

include Lodash core (~4kb)

_.assignIn, _.before, _.bind, _.chain, _.clone, _.compact, _.concat, _.create, _.defaults, _.defer, _.delay, _.each, _.escape, _.every, _.filter, _.find, _.flatten, _.flattenDeep, _.forEach, _.has, _.head, _.identity, _.indexOf, _.isArguments, _.isArray, _.isBoolean, _.isDate, _.isEmpty, _.isEqual, _.isFinite, _.isFunction, _.isNaN, _.isNull, _.isNumber, _.isObject, _.isRegExp, _.isString, _.isUndefined, _.iteratee, _.keys, _.last, _.map, _.matches, _.max, _.min, _.mixin, _.negate, _.noConflict, _.noop, _.once, _.pick, _.reduce, _.result, _.size, _.slice, _.some, _.sortBy, _.tap, _.thru, _.toArray, _.uniqueId, _#value, & _.values

for more information: https://github.com/lodash/lodash/wiki/Build-Differences

Inapp methods

https://mozat.com/confluence/pages/viewpage.action?title=Custom+URL&spaceKey=LC

inapp.di(diPoint: DIPoint, params: Object = {})

Argument

dipoint: dipoint params: params.

Returns

Example

inapp.di(points(14012));

inapp.toast(text: String)

Argument

text: toast string.

Returns

Example

inapp.toast('toast test');

openAppPage(pageName: String)

Argument

pageName: page name.

page name:
mydiamond,home,mylevel,leaderboard,mytitle,topup,myprofile

unlockType
(set only when pageName == "mytitle")
// -1: default
//  0:  ‘all’
//  1: ‘broadcaster’
//  2: ‘looper ’

Returns

Example

inapp.openAppPage('mytitle');

openVideo(sid: String, cid: String)

Argument

sid: session id cid: channel id

Returns

Example

inapp.openVideo('v9495', '110012');

openURL(url: String, title: String)

Argument

url: url title : title

Returns

Example

inapp.openURL('http://www.google.com', 'Google');

API

see code for more informations

Points

see code for more informations