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

event-sdk

v0.1.20

Published

1. [ Event SDK. ](#event_sdk) 2. [ Description. ](#desc) 3. [ How to run. ](#how_to_run) 4. [ How to use Redux Module. ](#redux_module)

Downloads

11

Readme

Table of Content

  1. Event SDK.
  2. Description.
  3. How to run.
  4. How to use Redux Module.

Core

Linting

Run event-sdk-format to run ESLint with Prettier.

Event SDK

This source contains basic Webpack Configuration (Dev + Pro) + ESLint + Prettier

Description

This project is mostly based on CreateReactApp but with some minor changes. This will be the basic tool for all Events and Tools

HOW TO RUN

You just need to call

event-sdk --mode development --file path/to/your/project/index

With --mode is the NODE environment and --file is the entryPoint. You can replace "--file" with "FILENAME="

How to map local module with command script

How to use Redux Module

This redux context is compatible with react-redux 7+. You can attach dynamic reducer to a component ( when it's mounted ). This solution based on Code Splitting ( https://redux.js.org/recipes/code-splitting ). In your component:


import injectReducer from "sdk-redux/withReducer";
import reducer from "PATH_TO_YOUR_REDUCER/reducers/YOUR_REDUCER";
import { createStructuredSelector } from "reselect";
import { compose } from "redux";

export function mapDispatchToProps(dispatch) {
  //...
}

const mapStateToProps = createStructuredSelector({
  //...
});

const withReducer = injectReducer(MODULE_NAME, reducer);
const withConnect = connect(
  mapStateToProps,
  mapDispatchToProps
);

export default compose(
  withConnect,
  withReducer
)(HomePage);

>Note: MODULE_NAME must be unique between your projects.

Reselect

Reselect is a library used for slicing your redux state and providing only the relevant sub-tree to a react component. It has three key features:

  1. Computational power
  2. Memoization
  3. Composability

Imagine an application that shows a list of users. Its redux state tree stores an array of usernames with signatures:

{ id: number, username: string, gender: string, age: number }.

Let's see how the three features of reselect help.

  • Computation: While performing a search operation, reselect will filter the original array and return only matching usernames. Redux state does not have to store a separate array of filtered usernames.
  • Memoization: A selector will not compute a new result unless one of its arguments change. That means, if you are repeating the same search once again, reselect will not filter the array over and over. It will just return the previously computed, and subsequently cached, result. Reselect compares the old and the new arguments and then decides whether to compute again or return the cached result.
  • Composability: You can combine multiple selectors. For example, one selector can filter usernames according to a search key and another selector can filter the already filtered array according to gender. One more selector can further filter according to age. You combine these selectors by using createSelector()

https://medium.com/netscape/a-guide-to-create-a-nodejs-command-line-package-c2166ad0452e.

Build OUTPUT

The most standard folder structure is

  • src/projects/your-project/index.js
  • src/events/your-project/index.js

The build result for this structure will be: build/your-project.js

Tips

Append variables and mixins automatically for every *.scss file

Add *.scss file in src/style/loader/. Every file in this folder will be loaded when run build or dev