Awesome Micro npm Packages
Micro npm Packagesを扱う資料や関連プロジェクトをまとめたAwesomeリストです。
記事
- One-line node modules
- Module best practices
- Evaluating Packages Part 1 - Turn to community
- Evaluating Packages Part 2 - Review repository
- Small modules: it’s not quite that simple
- In Defense of Hyper Modular JavaScript
- Tiny npm package: Guidelines to create a Node.js module following the small package philosophy
- The cost of small modules
モジュール
配列
- is-sorted - 配列がソート済みか確認する小さなモジュール。
- array-first - 配列の先頭要素、または先頭からn個の要素を取得する。
- array-last - 配列内の最後の要素を返す。
- arr-flatten - 配列を再帰的にフラット化する。
- dedupe - 配列から重複を削除する。
- array-range - 指定範囲の新しい配列を作成する。
- arr-diff - Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
- filled-array - Returns an array filled with the specified input
- map-array - オブジェクトのキーと値を配列にマップする。
- in-array - Return true if any of passed values exists in array - faster than using indexOf.
- unordered-array-remove - Efficiently remove an element from an unordered array without doing a splice.
- array-swap - Swap position of two items in an array.
- mirrarray - Creates a keymirror object from an array of valid keys.
- group-array - オブジェクト配列をリストへグループ化する。
- array.chunk - 配列/TypedArrayを指定サイズのチャンクに分割する。
- fast-cartesian - 高速な直積。
文字列
- decamelize - キャメルケース文字列をカスタム区切り文字付きの小文字へ変換する: unicornRainbow → unicorn_rainbow。
- pad-left - Left pad a string with zeros or a specified string.
- to-camel-case - 文字列をキャメルケースへ変換する。
- to-capital-case - 文字列をキャピタルケースへ変換する。
- to-constant-case - 文字列をコンスタントケースへ変換する。
- to-dot-case - 文字列をドットケースへ変換する。
- to-no-case - 文字列から既存のケースを除去する。
- to-pascal-case - 文字列をパスカルケースへ変換する。
- to-sentence-case - 文字列を文形式のケースへ変換する。
- to-snake-case - 文字列をスネークケースへ変換する。
- to-space-case - 文字列をスペース区切りケースへ変換する。
- to-title-case - 文字列をタイトルケースへ変換する。
- node-slug - slugifies even utf-8 chars.
- rtrim - Strip whitespace - or other characters - from the end of a string.
- slice.js - Javascript library to enhance String.substring / Array.slice with python slice style.
- strip-ansi - ANSIエスケープコードを除去する。
- striptags - An implementation of PHP’s strip_tags in Node.js.
- parse-next-json-value - Parse next JSON value from string allowing extraneous characters after value.
- pluralize - A very tiny library to pluralize words
日付と時刻
- pretty-ms - ミリ秒を人間が読みやすい文字列へ変換する: 1337000000 → 15d 11h 23m 20s。
- hirestime - A wrapper around the built-in high resolution timer which simplifies the calculation of timestamps.
- periods - Defined time-periods constants for Javascript, in milliseconds.
- fecha - JavaScriptの日付の整形と解析。
- akamai-time-reference - Get reference time using Akamai’s time reference service.
- timeago.js - A tiny(~1.7kb) library used to format date with
*** time agostatement. - count-days-in-month - 指定月の日数を取得する。
- time-stamp - 整形済みタイムスタンプを取得する。
- twas - Generate a relative time string (Example: “3 seconds ago”)
オブジェクト
- map-obj - オブジェクトのキーと値を新しいオブジェクトへマップする。
- filter-obj - オブジェクトのキーと値をフィルタリングする。
- object-values - オブジェクトの値を取得する。
- object-pairs - Turn an object into list of [key, value] pairs for mapping, iterating or other purposes.
- zipmap - Returns a map with the keys mapped to the corresponding vals. zipmap also accepts a single value of objects or pairs.
- just-pluck - Pluck without the madness.
- deep-equal - Nodeのassert.deepEqual()アルゴリズムをスタンドアロンモジュールとして提供する。
- deep-assign - 再帰的なObject.assign()。
- set-value - Create nested values and any intermediaries dot notation (
'a.b.c') paths. - get-value - Use property paths (a.b.c) to get a nested value from an object.
- has-value - Returns true if a value exists, false if empty. Works with deeply nested values using dot notation (
'a.b.c') paths. - has-key-deep - Deep-search objects for keys. Keys can be searched by providing an array of keys, or using a dot-notiation.
- flatkeys - Flatten object key hierarchies into a list of strings using a custom separator.
- flatten-obj - Converts an object literal with deeply nested nodes to a simple key/value object.
- is-empty-object - オブジェクトが空か確認する。
- stringify-object - Stringify an object/array like JSON.stringify just without all the double-quotes.
- sorted-object - キーをソートしたオブジェクトのコピーを返す。
- static-props - Defines static object attributes using
Object.defineProperties - missing-deep-keys - Returns an array of keys from first object that are missing in second.
- has-own-property - Check if an object has a local property.
- merge-objects - Deep-merge two objects. Arrays that are values of the same object key get concatenated.
- deep-object-diff - Deep diff two JavaScript Objects while preserving the data structure. Including nested structures of Arrays and Objects.
関数
- compose-function - 小さな関数から新しい関数を合成する
f(g(x))。 - curry - 複雑すぎないカリー化関数。
- once - 関数を正確に一度だけ実行する。
- deep-bind - Bind a context to all functions in an object, including deeply nested functions.
- identity-function - 常に入力引数を返す。
- mem - An optimization technique used to speed up consecutive function calls by caching the result of calls with identical input.
- throttle-debounce - 関数をthrottle/debounceする。
- compose-tiny - A very tiny and fast compose function.
数学
- is-even - A good way to tell if a number is even or not (avoids type issues). Uses
is-oddandis-numberunder the hood. - is-number - 値が数値なら
trueを返す。 - is-odd - A good way to tell if a number is odd or not (avoids type issues). Uses
is-numberunder the hood. - easy-math.js - A tiny easy math library including addition, multiplication, subtraction, and division.
- my-prime - A good way to tell if a number is prime or not.
- fun-gcd - A tiny math library to get gcd of two numbers using Euclidean algorithm
ストリーム
- through2 - Tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise.
- through2-filter - A through2 to create an Array.prototype.filter analog for streams.
- through2-map - A through2 to create an Array.prototype.map analog for streams.
- stream-spigot - テストや単純な関数のReadableストリーム化に役立つ、読み取り可能ストリームジェネレーター。
- concat-stream - 文字列またはデータを連結し、結果をコールバックで返す書き込み可能ストリーム。
- JSONStream - ストリーミングJSON.parseおよびstringify。
- through2-map-promise - A small promise-based wrapper for through2.
- pump - ストリームをパイプし、いずれかが閉じたらすべて閉じる。
- split - ストリームを分割・再結合し、各行をチャンクにする。
- is-stream - 対象がNode.jsストリームか確認する。
- syncthrough - Transform your data as it pass by, synchronously.
Promise
- pify - コールバック形式の関数をPromise化する。
- promise-all-props -
Promise.allに似ているが、オブジェクトプロパティ用。 - sleep-promise - 指定遅延後にPromiseをresolveする。
- is-promise - オブジェクトがpromises-a+ Promiseのようかテストする。
データ構造
- quetie - とてもかわいくて小さなqueue/deque実装。
ファイルシステム
- rimraf - node用の深い削除モジュール(rm -rfのようなもの)。
- mkdirp - mkdir -pのように再帰的にmkdirする。
- du - du -sbのシンプルなJavaScript実装。
- file-size - Lightweight filesize to human-readable / proportions w/o dependencies.
- tmp - node.js用の一時ファイル・ディレクトリ作成機能。
- fs-promise - Node fs methods as Promise/A+ (optional fs-extra, graceful-fs).
- read-git-user - Reads the username and email from
.gitconfig:wrench: and returns it as json object.
ブラウザー
- delegate - 軽量なイベント委譲。
- insert-css - CSS文字列をheadへ挿入する。
- dom-element-value - DOM要素値のgetter/setter。
- image-promise - Load one or more
<img>s in a Promise. - get-media-size - Get the original size of any
img/video/svg/canvastags or canvas context. - document-ready - モダンブラウザー用のdocument readyリスナー。
- copee - ブラウザーからクリップボードへネイティブにテキストをコピーする。
Semver
- semver - npmで使われるセマンティックバージョンパーサー。
- semver-max - semverに従って最大(または最小)バージョンを見つける。
- semver-first-satisfied - Find minimum in an array of version that satisfies a semver range.
CLI
- abbrev - 指定された文字列集合に対する一意な略語の集合を計算する。
- glob - node.js向けのGlob機能。
- username - 現在のユーザー名を取得する。
- minimist - 引数オプションを解析する。
- png-to-ico - Convert png to windows ico format.
- help-version - Easily handle —help and —version arguments in your CLI application
モジュール管理
- pkg-conf - 最も近いpackage.jsonから名前空間付き設定を取得する。
- normalize-pkg - Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.
ジェネレーター
- is-generator - 指定値がジェネレーター関数か確認する。
その他
- uuid - JavaScriptでRFC準拠UUIDを生成する。
- node-mime - mime-dbモジュールに基づく包括的なMIME型マッピングAPI。
- not-defined - Checks if foo is not defined, i.e. undefined, null, an empty string, array or object.
- is-fqdn - 文字列が完全修飾ドメイン名を表すか確認する。
- shurley - Parses URLs from user input (with potential typos in protocols, bad copy+paste, etc.) and returns a proper URL.
- mime-type-check - 拡張子からファイルのMIME型を取得する。
- nanoid - A tiny (130 bytes), secure, URL-friendly, unique string ID generator for JavaScript
ツール
- npm-deprecated-check - 非推奨パッケージを確認し、代替パッケージを推奨する。
関連リスト
このセクションには、小さなNPMモジュールを使用または作成する際に役立つawesomeリストを含めています。
- awesome-nodejs - 素晴らしいNode.jsパッケージとリソースのキュレーションリスト。
- awesome-npm - 優れたnpmリソースとヒント。
フォローすべき小規模モジュールの達人
これらの人々は、単一責任の哲学に従う素晴らしいNPMモジュールを開発しています。 フォローして新たな優れたモジュールを見つけましょう:
コントリビュート
コントリビュートを歓迎します。まず貢献ガイドラインを読んでください。
ライセンス
法律で可能な限り、Andrea Parodiはこの作品に関するすべての著作権および関連・近接権を放棄しています。
