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

sami.js

v2.0.1

Published

Sami (smi) parser written with javascript.

Readme

Sami.js

개발중이니 아직 쓰지 마세요!

주말 안에 끝내긴 개뿔 욕심내다가 구조가 쓸 데 없이 복잡해졌음...

Usage

// Node.js
const Sami = require('sami.js');
// 브라우저
<script src="./dist/sami.js"></script>

// 웹에서 쓸 조그만 버전이 필요하세요?
// 파일 불러오기 기능이 빠진 Sami.lite.js를 사용하세요!
// 대충 657KB정도 절약됩니다.
<script src="./dist/sami.lite.js"></script>

// if (node) {
//     파일시스템이 사용됩니다.
// } else (web browser) {
//     XMLHttpRequest(AJAX)가 사용됩니다.
// }
// sami.lite.js에선 이 메소드가 지원되지 않습니다.
// 인코딩 자동 인식 / UTF-8로 변환 해줍니다.
let subtitle = Sami.load('./subtitle.smi', 'KRCC', true);
let subtitle = new Sami('KRCC'); subtitle.load('./subtitle.smi', true); // 다른 방법

// 문자열에서 읽어옵니다!
let subtitle = Sami.load('<SAMI>...</SAMI>', 'KRCC');
let subtitle = new Sami('KRCC'); subtitle.load('<SAMI>...</SAMI>'); // 다른 방법

// 기본 값으로, HTML 출력 모드를 사용합니다.
subtitle.setHtmlOutput(true);
// HTML 대신 Raw JSON 데이터를 사용합니다.
subtitle.setHtmlOutput(false);

// 플레이어는 포함되어 있지 않아요 :D
// 
// return { 'class': 'KRCC', 'id': 'STDPrn', content: '<p><b>Hello</b>, <i>World</i>!</p>' }
// 
// json 출력 모드일 경우,
// return { 'class': 'KRCC', 'id': 'STDPrn', content: [
//     { type: 'bold', content: [ { type: 'node', content: 'Hello' } ] },
//     { type: 'node', content: ', ' },
//     { type: 'italic', content: [ { type: 'node', content: 'World' } ] },
//     { type: 'node', content: '!' },
// ] }
subtitle.at(player.getTime());

// 스타일이 없는 자막 파일의 경우, 빈 문자열을 출력합니다.
// 아무 처리도 하지 않은 데이터이니 XSS에 주의하세요!
subtitle.css