Giter VIP home page Giter VIP logo

uri-js-replace's Introduction

URI parsing/validating/resolving library

Replacement for abandoned library uri-js aka "URI.js"

NPM

  • Based on Node.js and browser URL api
  • 99% compatible with original URI.js library
  • Solves "The punycode module is deprecated" warning in Node
  • Tested with libraries: ESLint, Webpack, Ajv

Usage

NPM

Add to your package.json

{
  "overrides": {
    "uri-js": "npm:uri-js-replace"
  }
}

and run

npm update

Yarn

{
  "resolutions": {
    "uri-js": "npm:uri-js-replace"
  }
}

Library usage examples

Parsing

import * as URI from "uri-js";

URI.parse("uri://user:[email protected]:123/one/two.three?q1=a1&q2=a2#body");
//returns:
//{
//  scheme : "uri",
//  userinfo : "user:pass",
//  host : "example.com",
//  port : 123,
//  path : "/one/two.three",
//  query : "q1=a1&q2=a2",
//  fragment : "body"
//}

Serializing

URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer"

Normalizing

URI.normalize("URI://www.example.org/red%09ros\xE9#red") === "uri://www.example.org/red%09ros%C3%A9#red"

Tests

All tests copied from original repository

vitest

Generating d.ts files

npm i -g typescript
tsc

NPM

https://www.npmjs.com/package/uri-js-replace

uri-js-replace's People

Contributors

andreinwald avatar

Stargazers

Xavier Raffin avatar Tóth Ambrus avatar Syndesi avatar Julian Lu avatar William Stewart avatar Justy Robles avatar Steven Levithan avatar

Watchers

Peter McArthur avatar  avatar

uri-js-replace's Issues

Yarn setup

I've just realised for yarn it's

"resolutions": {
    "uri-js": "npm:uri-js-replace"
  }

worth mentioning I think

some issue

@alapanerao you wrote, that this replacement library didnt worked for you.
Could you please provide more details?

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.