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

@linx-impulse/commons-js

v4.4.1

Published

A library with common function implementations for Javascript Applications.

Downloads

20

Readme

Linx Commons-js CircleCI

A library with common function implementations for Javascript Applications.

Usage

With Webpack

If your application uses some module bundler, you can import the whole Commons-js library, a single module, or just a single function, making your source code smaller because only the features you need will be concatened to your build application.

The examples below were tested using Webpack, if you use another module bundler things might not work as well as expected.

ES Modules (Recommended)

Import the whole library and use it on your app:

import { commons } from '@linx-impulse/commons-js';

// make an ajax request
commons.http.ajax({
  url: 'http://www.google.com',
  callback: () => {
    console.log('OK');
  }
});

Import just the Http module. Only the implementation of this module functions will be bundled to your application source code.

import { http } from '@linx-impulse/commons-js/http';

// make an ajax request
http.ajax({
  url: 'http://www.google.com',
  callback: () => {
    console.log('OK');
  }
});

Import just the ajax function. Only the implementation of this function will be bundled to your application source code.

import { ajax } from '@linx-impulse/commons-js/http/ajax';

// make an ajax request
ajax({
  url: 'http://www.google.com',
  callback: () => {
    console.log('OK');
  }
});

CommonJS Modules

The Commons always exports the main module/function as default export of a file, so if your application uses CommonJS syntax, you can require the default module of each file.

Examples:

Require the whole library and use it on your app:

const commons = require('@linx-impulse/commons-js');

// make an ajax request
commons.http.ajax({
  url: 'http://www.google.com',
  callback: () => {
    console.log('OK');
  }
});

Require just the Http module. Only the implementation of this module functions will be bundled to your application source code.

const http = require('@linx-impulse/commons-js/http');

// make an ajax request
http.ajax({
  url: 'http://www.google.com',
  callback: () => {
    console.log('OK');
  }
});

Require just the ajax function. Only the implementation of this function will be bundled to your application source code.

const ajax = require('@linx-impulse/commons-js/http/ajax');

// make an ajax request
ajax({
  url: 'http://www.google.com',
  callback: () => {
    console.log('OK');
  }
});

Contributing

Code Style

We follow Airbnb JavaScript Style Guide and use eslint to validate the code. Before push a commit please run npm run lint to validate your code.

Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate our change log.

The Commit Message Guidelines are documented here: https://share.linx.com.br/x/0txLAg.