@btilford/ts-base-browser
ts-base browser package
Last updated 3 months ago by btilford .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @btilford/ts-base-browser 
SYNC missed versions from official npm registry.

ts-base-browser

Installation

npm install --save @btilford/ts-base-browser

Features

Load Env data from the DOM

<html>
<head>
<meta name="cfg:appOptions:x" content="abc">
<meta name="cfg:LEVEL" content="debug">
</head>
<body>
<script>
import {Env} from '@btilford/ts-base';
import {loadEnvWithMetaTags} from '@btilford/ts-base-browser';
const env = Env.load([
  loadEnvWithMetaTags('cfg:', document);
]);
console.assert(env.getConfig('appOptions:').x === 'abc');
console.assert(env.getProp('LEVEL') === 'debug');
</script>
</body>
</html>

Timer for Performance API

There is a Timer implementation that records marks and measures to window.performance. It can be used with the @Timed() and @TimedAsync() decorators.

import {Timed, bootstrap} from '@btilford/ts-base';
import {PerformanceTimerFactory} from '@btilford/ts-base-browser';



bootstrap({
  appName:'my-app',
  apm: {
    features: {
      timer: new PerformanceTimerFactory({})
    } 
  } 
});


class Example {
  @Timed() // Record time for calls to this function.  
  method() {
    console.log('called');
  } 
}

See ts-base for additional information.

Current Tags

  • 1.1.2                                ...           latest (3 months ago)

10 Versions

  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
  • 1.1.1-0                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 1.0.0                                ...           4 months ago
  • 0.1.0                                ...           4 months ago
  • 0.0.7                                ...           4 months ago
  • 0.0.6                                ...           4 months ago
  • 0.0.5                                ...           4 months ago
  • 0.0.4                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (61)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |