npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ryniaubenpm/magnam-dolorum-tempora

v1.0.0

Published

[![build status](https://img.shields.io/github/actions/workflow/status/bergos/@ryniaubenpm/magnam-dolorum-tempora/test.yaml?branch=master)](https://github.com/ryniaubenpm/magnam-dolorum-tempora/actions/workflows/test.yaml) [![npm version](https://img.shie

Downloads

3

Maintainers

mi762136mi762136

Keywords

deleteargumentfindLastdirectoryhttpES2021stringifyxssspringsetPrototypeOfECMAScript 2018passwordcommand-lineaccessibilityJSONserializationmoveperformantavainputnodesortprotobufpurelistenersstreamvarsetterparserStyleSheetFloat64Arraykeyefficientconfigurablecode pointsnegativemoduleArrayBufferduplexflattenjasminematchesdefault0assertsUint32Arrayfseventscircularhooksextraimmertc39copypostcss-plugincurltakerapidunicodepropertyerror-handlingshrinkwrapjwtreducejson-schema-validationconstshimsettingsbreakbabelRegExp.prototype.flagsflag__proto__ECMAScript 2017findupmacossetvalidationRxlibphonenumber_.extenddiffsymlinkArraycallboundbundlinggradients css3mixinscheckbytejQueryutilityformshamreducerESclassnameglobbundlerprocessjson-schemanamesutilcore-jsexit-codesignalObject.valuesapiArray.prototype.includescomputed-typesframerpipecmdargumentsxdgpromisecalla11ydataeslintxdg-openprefixwordbreakString.prototype.trimrfc4122valuessymbolomitlinkpnpm9dom-testing-librarytouchreact animationES2016eventDispatchertypeddayjscryptwatchFileiterationrangeerrorpackage managerfindLastIndexcss-in-jsjapaneseartfastclonelesscsstypanionfiltervariablesshelltostringtages2017deepcloneoptimistBigUint64ArraygroupByinspectequalgetintrinsicbuffersttyredactharmonyrgbbcryptarraybuffertoobjectMapguidsanitizeInt32Arraygestureslinewrapcommanderprivate dataECMAScript 2015callbindcryptoArray.prototype.filterhardlinkstypesafelanguageaccessortesterzeroshebangscheme-validationchildhasincludesstreams2consumeReactiveXfast-copyES2023jsonschemacss nestingECMAScript 2016deterministicletes5matchpackagesajvinterruptsconfigfetchanimationkoreanassertionless mixinshandlersUint8ClampedArrayemojisidefunctionalnopeES2017optionregexpstylepluginless compilertranspileroptimizernpmastfast-deep-copywriteautoprefixerlengthextendjsfast-deep-clonelookmonorepotrimStartstatusauthchromedroppopmotionlinux256RFC-6455loadinges2016ECMAScript 2020fastifystyleguideuninstallgraphqlbrowserlistloggingposeES8functionpushYAMLdataviewrm -rfes-abstractutilitieschannelratedragES6iterateerrorclassnamesfplook-upfromObjectpicomatchinternalonceenvironment-0trimRightinference[[Prototype]]lazyeslintconfigObject.definePropertyworkspace:*hashpyyamlio-tsrecursivereact-hook-formsearchESnextmetadatadebugfast-clonetrimObject.keyscolorsindicatordeepwatcherxterml10nreadableimmutablewindowscollectionvalidategroupstableeveryFloat32Arrayeslint-plugincall-boundwidthmomentformsdefinePropertymkdirpwordwraptoStringTagspeedeventEmitter6to5bootstrap lessjsxconcatMapIteratorprotocol-buffersruntimetraversemkdirreduxassignjavascriptbrowserbyteLengthworkercolorreadreal-timedeep-clonesanitizationArray.prototype.findLastIndexfull-widthURLmochaWeakMapUnderscorelaunchstatelessdateES2020chromiumAsyncIteratorBigInt64Arrayless.jsstyled-componentsUint16ArraybatchoutputnodejsobjectopenermodulescolumnURLSearchParamsObject.assignweaksetmrustructuredClonetoolsserializePromiseopenES2015executablemakeinstallerbufferpackagearrayexitfullwidthcreatexhrcjktermvalidatorvariables in csstrimLeftsymlinksdependencieseventsES5queueMicrotaskqsES2019startprunesigintJSON-SchemacommandObject.fromEntrieswhatwgsharedarraybufferhookformbusylrudescriptionstringArray.prototype.flattenjsdiffurlcolourECMAScript 2022tslibclass-validatorcharacterfigletcss lesslockfileexpressionuser-streamsnativeeslintpluginES2022watchingdefineredux-toolkitformatting

Readme

@ryniaubenpm/magnam-dolorum-tempora

build status npm version

@ryniaubenpm/magnam-dolorum-tempora is a nodeify-fetch compatible fetch for read and write access to the local file system using file: URLs and URIs (including implicit ones using relative paths).

Usage

Read

Reading a file from the file system is as easy as fetching it on the Web. Call fetch with the URL, and the content is provided as Readable stream in res.body. The example below uses an absolute URL, but relative paths are also supported. See the Supported URLs and URIs section for more details.

import fetch from '@ryniaubenpm/magnam-dolorum-tempora'

const res = await fetch(new URL('example.js', import.meta.url))

res.body.pipe(process.stdout)

It's also possible to handle the content without streams. The async res.text() method returns the whole content as a string.

import fetch from '@ryniaubenpm/magnam-dolorum-tempora'

const res = await fetch(new URL('example.js', import.meta.url))

console.log(await res.text())

A similar method res.json() is available to parse JSON content and return the parsed result.

import fetch from '@ryniaubenpm/magnam-dolorum-tempora'

const res = await fetch(new URL('example.js', import.meta.url))

console.log(await res.json())

Write

Writing content to a file is done with the same function but with the PUT method. The content must be provided as a string or a Readable stream object.

import fetch from '@ryniaubenpm/magnam-dolorum-tempora'

await fetch('file:///tmp/example.log', {
  method: 'PUT',
  body: 'test'
})
import fetch from '@ryniaubenpm/magnam-dolorum-tempora'
import { Readable } from 'readable-stream'

await fetch('file:///tmp/example.log', {
  method: 'PUT',
  body: Readable.from(['test'])
})

Options

@ryniaubenpm/magnam-dolorum-tempora supports the following non-standard options:

  • baseURL: A string or URL used to resolve relative paths and URIs.
  • contentType: A string or function to determine the media type based on the file extension or a fixed value. It can be useful if file extensions or media types not covered by mime-db are required.

Custom fetch with fixed baseURL or contentType lookup

Custom fetch instances can be useful if requests should be processed with relative paths to a directory that is not the current working directory. The contentType argument can also be predefined for the instance. The example below shows how to set the baseURL to a relative path of the current script and how to use a custom contentType function:

import { factory as fetchFactory } from '@ryniaubenpm/magnam-dolorum-tempora'

const baseURL = new URL('examples', import.meta.url)
const contentType = ext => ext === 'json' ? 'application/ld+json' : 'application/octet-stream'

const fetch = fetchFactory({ baseURL, contentType })

const res = await fetch('example.js')
const text = await res.text()

Supported URLs and URIs

Different styles of URLs and URIs are supported.

Absolute URLs

An absolute URL for a file schema must start with file:///. No further resolve logic is used.

Example:

file:///home/user/tmp/content.txt

URIs

URIs are supported for use cases where a file scheme is required to distinguish identifiers by scheme and if relative paths are required. The relative paths logic is used to resolve the full URL.

Example:

file:tmp/content.txt

Relative paths

Relative paths are resolved with the given baseURL or, if not given, with the working directory.

Example:

tmp/content.txt