Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chober

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chober

Chober.js - is a collection of methods that are used by programmers every day. We decided to put all the methods together so as not to copy them from project to project.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58
decreased by-19.44%
Maintainers
1
Weekly downloads
 
Created
Source

Chober.js

npm version

Docs | Licence

A collection of methods that are used by programmers every day. We decided to put all the methods together so as not to copy them from project to project.

Quick start

Install with npm.

$ npm i chober

or download and install with script.

<script src="chober.min.js"></script>

or cdn

<!-- Latest -->
<script src="https://cdn.jsdelivr.net/npm/chober/dist/chober.min.js"></script>

<!-- With version -->
<script src="https://cdn.jsdelivr.net/npm/chober@0.1.0/dist/chober.min.js"></script>

npm

Import one method
import { isEmpty } from 'chober';

isEmpty([]);
// => true
Import all library and use all methods
import _c from 'chober';

_c.isEmpty([]);
// => true

_c.clone({ key: 'value' });
// => { key: 'value' }
Import only one method

If you import one method, other methods will not be imported.

import isEmpty from 'chober/lib/isEmpty'; // ~600B

isEmpty([]);
// => true

Browser

_c binds to the window.

<script src="chober.min.js"></script>
_c.isEmpty([]);
// => true

Add your methods

If you want to add your methods, read the instructions below.

  • Clone repository git clone https://github.com/BrooonS/chober.git.
  • Add method to lib folder. Example: lib/yourMethod.js.
  • Add comments to function params, if they exist.
  • Import method to index.js.
  • Run npm run build command.

Example

// lib/yourMethod.js

/**
 * Method to sum two numbers.
 *
 * @param {Number} a First number.
 * @param {Number} b Second number.
 * @returns {Number}
 *
 * @example
 * math(2, 2)
 * // => 4
 */
function math(a, b) {
  return a + b;
}

export default math;
// index.js

import yourMethod from './lib/yourMethod';

export {
  ... // other methods
  yourMethod,
};

class Chober {
  constructor() {
    Object.assign(this, {
      ... // other methods
      yourMethod,
    });
  }
}

Methods

All methods you can find in our documentation.


© Valery Strelets

Keywords

FAQs

Package last updated on 10 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc