JSPM

@upendra.manike/dev-utils

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 16
    • Score
      100M100P100Q52099F
    • License MIT

    Developer utilities - logging, timing, query string parser, pub-sub event emitter

    Package Exports

    • @upendra.manike/dev-utils
    • @upendra.manike/dev-utils/dist/index.js
    • @upendra.manike/dev-utils/dist/index.mjs

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@upendra.manike/dev-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    dev-utils

    Developer utilities - logging, timing, query string parser, pub-sub event emitter.

    Installation

    npm install @upendra.manike/dev-utils

    Usage

    import { logger, measureTime, parseQueryString, EventEmitter } from '@upendra.manike/dev-utils';
    
    // Logging
    const log = logger('MyApp');
    log.log('Hello');
    
    // Timing
    const { result, time } = await measureTime(async () => {
      return await fetchData();
    });
    
    // Query string
    const params = parseQueryString('?name=John&age=30');
    
    // Events
    const emitter = new EventEmitter();
    emitter.on('event', (data) => console.log(data));
    emitter.emit('event', 'Hello');

    License

    MIT