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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pcs-asset

v1.0.1

Published

Pustaka aset dan komponen ikon untuk PCS.

Downloads

11

Readme

PCS Asset

Pustaka aset dan komponen ikon & utils untuk PCS, dibuat menggunakan Web Components dan vanilla JS.

Instalasi

npm install pcs-asset

Playground

Demo Playground


Utils (pcs-asset/utils)

Kumpulan fungsi utilitas vanilla JS yang bisa digunakan di React, Vue, maupun project JS lain.

Contoh Penggunaan

import { formatDate, formatDateTime, formatTime, debounce, throttle, isEmpty, copyToClipboard, randomString, formatCurrency } from 'pcs-asset/utils';

// Format tanggal dinamis
formatDate(new Date('2002-06-10'), 'dd-MM-yyyy'); // "10-06-2002"
formatDate(new Date('2002-06-10'), 'dd/MM/yyyy'); // "10/06/2002"
formatDate(new Date('2002-06-10'), 'dd-MMMM-yyyy'); // "10-Juni-2002"
formatDate(new Date('2002-06-10'), 'dd MMM yyyy'); // "10 Jun 2002"
formatDate(new Date('2002-06-10'), 'dd-MM-yy'); // "10-06-02"
formatDate(new Date('2002-06-10'), 'yyyy/MM/dd'); // "2002/06/10"

// Format waktu dinamis
formatTime(new Date('2025-10-06T13:45:12'), 'HH:mm'); // "13:45"
formatTime(new Date('2025-10-06T13:45:12'), 'HH:mm:ss'); // "13:45:12"

// Format dateTime dinamis
formatDateTime(new Date('2025-10-06T13:45:12'), 'dd MMMM yyyy HH:mm'); // "06 Oktober 2025 13:45"
formatDateTime(new Date('2025-10-06T13:45:12'), 'yyyy-MM-dd HH:mm:ss'); // "2025-10-06 13:45:12"

// Format uang
formatCurrency(1234567); // "Rp 1.234.567"
formatCurrency(1234567, ''); // "1.234.567"

// Debounce
const onInput = debounce((val) => console.log(val), 300);

// Throttle
const onScroll = throttle(() => console.log('scroll'), 500);

// Cek kosong
isEmpty(''); // true
isEmpty([]); // true
isEmpty({}); // true

// Copy ke clipboard
copyToClipboard('teks');

// Random string
randomString(10); // "aZ8kLmP0qR"


Penggunaan Icon (pcs-asset/icons)

React

Jika ingin menggunakan sintaks di JSX, Anda bisa membuat komponen wrapper seperti berikut:

import { PCSIcon } from 'pcs-asset/icons';

return (
  <PCSIcon name="Home" color="#F82C17" size={20} />
  <PCSIcon name="Profile" color="#F82C17" size={20} secondary-color="#b007c2ff"  />
)

Dengan cara ini, Anda bisa menggunakan seperti komponen React biasa.

Vue

Di Vue, cukup import dan gunakan seperti tag HTML biasa:

import 'pcs-asset/icons';
<template>
  <pcs-icon name="Home" color="#333" size="32"></pcs-icon>
</template>