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

classter

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classter

A utility for conditionally joining classNames together. Handles various argument types: string, object, arrays, etc.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

classterDocumentation

A utility for conditionally joining classNames together. Handles various argument types: string, object, arrays, etc.

Installation

You can install the package using npm, yarn, or pnpm.

pnpm add classter

yarn install classter

npm install classter

Usage

import cls from "classter";

cls("foo", "bar"); // => 'foo bar'
cls("foo", { bar: true }); // => 'foo bar'
cls({ "foo-bar": true }); // => 'foo-bar'
cls({ "foo-bar": false }); // => ''
cls({ foo: true }, { bar: true }); // => 'foo bar'
cls({ foo: true, bar: true }); // => 'foo bar'

// lots of arguments of various types
cls("foo", { bar: true, duck: false }, "baz", { quux: true }); // => 'foo bar baz quux'

// other falsy values are just ignored
cls(null, false, "bar", undefined, 0, 1, { baz: null }, ""); // => 'bar 1'

tsup

Bundle your TypeScript library with no config, powered by esbuild.

https://tsup.egoist.dev/

How to use this

  1. install dependencies
# pnpm
$ pnpm install

# yarn
$ yarn install

# npm
$ npm install
  1. Add your code to src
  2. Add export statement to src/index.ts
  3. Test build command to build src. Once the command works properly, you will see dist folder.
# pnpm
$ pnpm run build

# yarn
$ yarn run build

# npm
$ npm run build
  1. Publish your package
$ npm publish

test package

https://www.npmjs.com/package/classter

FAQs

Package last updated on 23 Sep 2024

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