GithubHelp home page GithubHelp logo

unkit's Introduction

unkit

UnJS standard library

This package aggregates a collection of useful packages from unjs for ease of use.

๐Ÿ’ฟ Install

Install using npm or yarn:

npm i unkit
# or
yarn add unkit

Import a subpath:

// ESM / Typescript
import { pascalCase  } from 'unkit/string'

// CommonJS
const { pascalCase } = require('unkit/string')

๐Ÿ’ก Note: Please always explicitly install unkit dependency even if it is already installed by another package in node_modules.

Check โฌ†๏ธ Upgrading Guide for upgrading versions.

๐Ÿ“™ Libraries

Libraries are exposed via semantic subpaths. Refer to each package documentation for available utilities.

Subpath Packages
unkit/env unjs/std-env
unkit/esm unjs/mlly
unkit/fetch unjs/ohmyfetch
unkit/http unjs/h3, unjs/is-https
unkit/object unjs/defu, unjs/destr
unkit/promise unjs/items-promise
unkit/string unjs/scule
unkit/url unjs/ufo

/env

Useful environment information of running code.

๐Ÿ‘‰ See unjs/std-env for more information.

// ESM / Typescript
import {  production, dev } from 'unkit/env'

// CommonJS
const { production, dev } = require('unkit/env')

/esm

Missing ECMaScript module utils for Node.js

๐Ÿ‘‰ See unjs/mlly for more information.

// ESM / Typescript
import { createCommonJS, resolve } from 'unkit/esm'

/fetch

A better fetch API. Works on node, browser, and workers

๐Ÿ‘‰ See unjs/ohmyfetch for more information.

// ESM / Typescript
import { $fetch } from 'unkit/fetch'

// CommonJS
const { $fetch } = require('unkit/fetch')

/http

Helpers for creating HTTP servers

๐Ÿ‘‰ See unjs/h3 and unjs/is-https for more information.

// ESM / Typescript
import { useBody, isHTTPS } from 'unkit/http'

// CommonJS
const { useBody, isHTTPS } = require('unkit/http')

/object

Utilities for working with objects and serialization

๐Ÿ‘‰ See unjs/defu and unjs/destr for more information.

// ESM / Typescript
import { defaults, parseJSON } from 'unkit/object'

// CommonJS
const { defaults, parseJSON } = require('unkit/object')

/promise

Promise utils

๐Ÿ‘‰ See unjs/items-promise for more information.

// ESM / Typescript
import { serial, parallel } from 'unkit/promise'

// CommonJS
const { serial, parallel } = require('unkit/promise')

/string

String manipulation utils

๐Ÿ‘‰ See unjs/scule for more information.

// ESM / Typescript
import { snakeCase, upperFirst } from 'unkit/string'

// CommonJS
const { snakeCase, upperFirst } = require('unkit/string')

/url

Utilities to work with URLs

๐Ÿ‘‰ See unjs/ufo for more information.

// ESM / Typescript
import { joinURL, withQuery } from 'unkit/url'

// CommonJS
const { joinURL, withQuery } = require('unkit/url')

โฌ†๏ธ Upgrading

Unkit uses npm dependencies with caret range, this means when you freshly install unkit, the latest features and fixes of sub-dependencies are installed. For upgrading we have two choices:

  • Use npm up unkit or yarn upgrade unkit: This will update the lock-file with minimal risk to the latest versions.
  • Remove package-lock.json or yarn.lock and reinstall dependencies with npm i or yarn this will update all nested dependencies to the latest.

License

MIT

unkit's People

Contributors

ecstrema avatar ineshbose avatar jahidanowar avatar nozomuikuta avatar pi0 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unkit's Issues

Support for CLI

Describe the feature

Context

I am currently using unjs/citty to make CLI tools.
While creating CLI tools, I have been saved by many unjs stacks such as

  • ๐ŸŒ† unjs/citty
  • ๐Ÿจ unjs/consola
  • ๐Ÿ’… unjs/changelogen
  • ๐Ÿ“ฆ unjs/unbuild
  • ๐ŸŸ unjs/jiti

There are others that are needed(magicast, unctx, c12, pathe, etc), but we believe the above are the minimum.
So, I would like to provide unkit for those who want to make CLI with unjs in the future.

Design

  • add src/cli.ts
  • add exports.cli options in package.json

Additional information

  • Would you be willing to help implement this feature?

Tasks

No tasks being tracked yet.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm ohmyfetch Unavailable

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • defu ^6.1.4
  • destr ^1.2.2
  • h3 ^0.8.6
  • is-https ^4.0.0
  • items-promise ^1.0.0
  • mlly ^0.5.17
  • ohmyfetch ^0.4.21
  • requrl ^3.0.2
  • scule ^0.3.2
  • std-env ^3.7.0
  • ufo ^0.8.6
  • unbuild ^1.2.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.