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

to-one

v1.0.4

Published

from zero to one

Downloads

20

Readme

라이브러리 개요

to-one은 0에서 1까지 증가시키며 리턴하는 typescript 라이브러리 입니다. easing, duration, partition 등의 옵션을 제공합니다. ​

설치

npm을 사용하여 설치할 수 있습니다.

npm install to-one

또는 yarn을 사용할 수도 있습니다.

yarn add to-one

예제 코드

라이브러리의 간단한 사용 예제 코드입니다.

import { zeroToOne } from 'to-one';

zeroToOne({
  easing: 'ease-out',
  duration: 1500, // 0에서 1이 되는 시간이 1.5초 소요됩니다.
  partition: 100, // 100번의 step을 거칩니다.
  callback: (value) => {
    setNum1(value);
  },
});

주요 옵션

easing

  • type: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out'
  • 0부터 1까지 증가율 곡선을 제공합니다.

duration

  • type: number
  • 증가되는 시간을 설정합니다. 단위는 (ms) 입니다.

partition

  • type: number
  • partition 만큼 분할하여 증가합니다.

callback

  • type: (value: number) => void;
  • 분할마다 Callback 함수를 실행합니다.

실제 사용 사례

라이브러리의 실제 사용 예시는 Demo에서 확인할 수 있습니다.

피드백 및 지원

라이브러리에 대한 피드백이나 문제 신고는 GitHub Issues 페이지에서 제공합니다.