@twodashes/node
v0.4.11
Published
Utility functions specifically for Node.js. HTTP requests, CLI arguments, promises, operating system, version, etc. See also @twodashes/universal and @twodashes/browser
Downloads
1
Readme
Utility functions for Node.js
See also @twodash/universal for all platforms, and @twodash/browser for the browser (including Webpack). Planned for the future are more platform-specific functions: "@twodash/rnative" for React Native, "@twodash/ionic", and in a galaxy far far away "@twodash/quasar".
Installation
These are exported for your choice of environment. When importing, specify cjs/esm/__ format. The __ is meant to be used with the browser <script>
tag. It creates a window.__
variable.
import { sort_by_rating_and_position } from "@twodash/universal/esm/sort_strings"
const sort_strings = require("@twodash/universal/esm/sort_strings")
Why not UMD modules standard? Code splitting. By specifying your choice "esm" (ES Modules), "cjs" (CommonJS) or "__" (window.__
), you're able to download only the specific functions you actually need, not everthing else. Additionally on the browser, you can download multiple times using multiple<script>
tags (for example both@twodashes/universal
and@twodashes/browser
, or/sort_strings
and/arrays
). All downloaded scripts will be combined into one single flatwindow.__
dictionary/object. See code sandbox. Please do message (Paul) if this is unclear, or if may know a better way of accomplishing all this.
Documentation
- coming soon - for now please see "./src" folder which uses standard JsDoc comments
Not ready
Currently under development. Not stable. Adding more functions.