Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
URL utils for humans
URL
to parse urls and encodingInstall using npm or yarn:
npm i @nuxt/ufo
# or
yarn add @nuxt/ufo
Import:
// CommonJS
const { normalizeURL, joinURL } = require('@nuxt/ufo')
// ESM
import { normalizeURL, joinURL } from '@nuxt/ufo'
Notice: You may need to transpile package and add URL polyfill for legacy environments
normalizeURL
// Result: /test?query=123%20123#hash,%20test
normalizeURL('test?query=123 123#hash, test')
// Result: http://loalhost:3000/
normalizeURL('http://localhost:3000')
joinURL
// Result: /a/b/c
joinURL('a', '/b', '/c')
// Result: http://foo.com/foo/bar/baz?test=123#token
joinURL('http://foo.com/foo?test=123#token', 'bar', 'baz')
withTrailingSlash
Ensures url ends with a trailing slash
// Result: /foo/
withTrailingSlash('/foo')
withoutTrailingSlash
Ensures url does not ends with a trailing slash
// Result: /foo
withoutTrailingSlash('/foo/')
MIT. Made with 💖
FAQs
URL utils for humans
The npm package @nuxt/ufo receives a total of 6,384 weekly downloads. As such, @nuxt/ufo popularity was classified as popular.
We found that @nuxt/ufo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.