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

mixgather

v1.0.1

Published

I am a product log maker, so I write logs day by day.

Downloads

45

Readme

Mixgather

NPM NPM GitHub Workflow Status

"I am a product log maker, so I write logs day by day."

Installation

$ yarn add mixgather

Usage

1. Init - Required

import mixgather from 'mixgather'

async inSomeSetupHook() {
  // ...other setup
  await mixgather.init({
    debug: process.env.NODE_ENV !== 'production',
    google: {
      id: 'G-XXXX'
    },
    mixpanel: {
      token: 'xxxxxx'
    }
  })
  // ...integrate track with router hooks
}

The init step is async, we should track after finishing it.

2. Track - Core

// Pages
mixgather.page('/path')
mixgather.page('/profile', 'User Home')

// Events
mixgather.event('some_action')
mixgather.event('el_clicked', {
  property: 'value'
})

// Screens
mixgather.screen('screen_name')
mixgather.screen('modal_name')

3. User - Optional

Set the userMeta on the gathers:

mixgather.setUser({ id: 'xxxxx', ...otherProps })

if id is null, will remove the current user.

4. Global Property - Optional

mixgather.setProperty({ appName: 'xxxxx', ...others })

if property value is null, will remove the property.

Get Vendors

Sometimes, we need to run vendor-spec APIs, getting $vendor sdk is necessary.

const gatherName = 'mixpanel' // 'google'
mixgather.getGather(gatherName).$vendor

Development

Run Example in Local

$ yarn dev

It starts a server at http://localhost:1234.

Reset Package Name

  1. git clone [email protected]:rct-ai/mixgather.git
  2. cd mixgather
  3. yarn
  4. yarn setup

Node.js, npm and/or yarn version

The lib relies on volta to ensure node version to be consistent across developers. It's also used in the GitHub workflow file.

Typescript

Leverages esbuild for blazing fast builds, but keeps tsc to generate .d.ts files. Generates two builds to support both ESM and CJS.

Commands:

  • build: runs typechecking then generates CJS, ESM and d.ts files in the build/ directory
  • clean: removes the build/ directory
  • type:dts: only generates d.ts
  • type:check: only run typechecking
  • type:build: only generates CJS and ESM

Tests

Mixgather uses ava and esbuild-register so that there is no need to compile before the tests start running. The coverage is done through nyc.

Commands:

  • test: runs ava test runner
  • test:coverage: runs ava test runner and generates coverage reports

Format & lint

This template relies on the combination of eslint — through typescript-eslint for linting and prettier for formatting. It also uses cspell to ensure spelling

Commands:

  • format: runs prettier with automatic fixing
  • format:check: runs prettier without automatic fixing (used in CI)
  • lint: runs eslint with automatic fixing
  • lint:check: runs eslint without automatic fixing (used in CI)
  • spell:check: runs spellchecking

Releasing

Under the hood, this library uses semantic-release and commitizen. The goal is to avoid manual release process. Using semantic-release will automatically create a github release (hence tags) as well as an npm release. Based on your commit history, semantic-release will automatically create a patch, feature or breaking release.

Commands:

  • cz: interactive CLI that helps you generate a proper git commit message, using commitizen
  • semantic-release: triggers a release (used in CI)