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

m-util

v0.0.11

Published

Utility.

Readme

m-util

npm total download npm version License

インストール - Install

$ npm i -S m-util

使い方 - Usage

Functions

    // ヒアドキュメント用
    String.prototype.uHereDoc = function() {…}
--
    // スラッシュ挿入
    String.prototype.uAddslashes = function(s) {…}
--
    // 文字列の繰り返し
    String.prototype.uRepeat = function(i) {…}
--
    // パスからファイル情報返す @return ['ファイル名','拡張子','拡張子抜きファイル名']
    String.prototype.uGetFileInfo = function() {…}
--
    // パスからファイル名を返す
    String.prototype.uGetFileNameExt = function() {…}
--
    // パスから拡張子を返す
    String.prototype.uGetFileExt = function() {…}
--
    // パスから拡張子抜きファイル名を返す
    String.prototype.uGetFileName = function() {…}
--
    // Math.floor(x)小数点以下指定
    Math.uFloor = function(x, scale) {…}
--
    // Math.ceil(x)小数点以下指定
    Math.uCeil = function(x, scale) {…}
--
    // Math.round(x)小数点以下指定
    Math.uRound = function(x, scale) {…}
--
    // 左空白詰め(右寄せ)
    uLpad = function(txt, pad) {…}
--
    // 右空白詰め(左寄せ)
    uRpad = function(txt, pad) {…}

NodeJS

// Here Documents var t = (function() {/* <script> $("*").css("border", "3px solid red"); </script> */}).toString().uHereDoc(); console.log(t); console.log(hr);

var path = 'test.png'; console.log(path.uGetFileInfo()); console.log(path.uGetFileNameExt()); console.log(path.uGetFileExt()); console.log(path.uGetFileName()); console.log(path); console.log(hr);

var path2 = '/Users/mac/Documents/vhosts/m-util/index.js'; console.log(path2.uGetFileInfo()); console.log(path2.uGetFileNameExt()); console.log(path2.uGetFileExt()); console.log(path2.uGetFileName()); console.log(path2); console.log(hr);

console.log(Math.uFloor(124.456, 1)); console.log(Math.uCeil(124.456, 1)); console.log(Math.uRound(124.454, 1)); console.log(Math.uRound(124.455, 1)); console.log(hr);

console.log(Math.uFloor(232.456, 2)); console.log(Math.uCeil(232.456, 2)); console.log(Math.uRound(232.454, 2)); console.log(Math.uRound(232.455, 2)); console.log(hr);

console.log('[' +uRpad("hoge") + ']'); console.log('[' +uLpad("hoge") + ']'); console.log(hr);

console.log('[' +uRpad("fuga", 10) + ']'); console.log('[' +uLpad("fuga", 10) + ']'); console.log(hr);

console.log('[' +escapeHtml('<>`"') + ']'); console.log(hr);

<script> $("*").css("border", "3px solid red"); </script>


[ 'test.png', 'png', 'test' ] test.png png test test.png


[ 'index.js', 'js', 'index' ] index.js js index /Users/mac/Documents/vhosts/m-util/index.js


124.4 124.5 124.5 124.5


232.45 232.46 232.45 232.46


[hoge ] [ hoge]


[fuga ] [ fuga]


[<>`"]


ライセンス - License

MIT License

作者 - Author