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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dreamoment/receptionist

v0.0.1

Published

<h1 align="center">receptionist</h1>

Downloads

5

Readme

Language: English | 中文简体

What is receptionist ?

threejs multi-function file loader that can handle a variety of common business scenarios, such as:

  • Download multiple files and get the total download progress.
  • Download data cannot be parsed by threejs loader and needs to be pre-processed. Because they could be encrypted or even compressed.

Features

  • lightweight and easy to use

  • multi-file download

  • data preprocessing

  • interface with all loaders in threejs

  • support typescript

Install

npm i @dreamoment/receptionist

Examples

import * as THREE from 'three'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
import Receptionist from '@dreamoment/receptionist'


const scene = new THREE.Scene()
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000 )
const ambientLight = new THREE.AmbientLight(0xffffff)
const directionalLight = new THREE.DirectionalLight(0xffffff)
directionalLight.position.set(1, 1, 1)
scene.add(ambientLight, directionalLight)

const renderer = new THREE.WebGLRenderer()
renderer.setSize(window.innerWidth, window.innerHeight)
document.body.appendChild(renderer.domElement)

const controls = new OrbitControls(camera, renderer.domElement)

camera.position.set(5, 5, 5)


// The models is simply encrypted
const monkey = Receptionist.createAsset('./monkey_encrypted.glb')
const ball = Receptionist.createAsset('./ball_encrypted.glb')
// monkey
//     .onLoad(data => {
//       console.log('data:', data)
//     })
//     .onProgress(progress => {
//       console.log(`progress: ${progress}`)
//     })
//     .onError(err => {
//       console.log(`error: ${err}`)
//     })
// ball
//     .onLoad(data => {
//       console.log('data:', data)
//     })
//     .onProgress(progress => {
//       console.log(`progress: ${progress}`)
//     })
//     .onError(err => {
//       console.log(`error: ${err}`)
//     })

// with interception
const interceptor = Receptionist.createInterceptor((buffer) => {
  let view = new Uint8Array(buffer)
  for (let i = 0; i < view.length; i++) {
    const item = 255 - view[i]
    view[i] = item
  }
  return view.buffer
})
interceptor.bind(monkey).bind(ball)
// or
// interceptor.bind([ monkey, ball ])

// without interception
// const monkey = Receptionist.createAsset('./monkey.glb')
// const ball = Receptionist.createAsset('./ball.glb')

const gltfLoader = new GLTFLoader()
const loader = Receptionist.createLoader(gltfLoader)
loader.bind(monkey).bind(ball)
// or
// loader.bind([ monkey, ball ])

const receptionist = new Receptionist()
receptionist
    .onLoad(data => {
      data.forEach((item) => {
        scene.add(item.scene)
      })
    })
    .onProgress(progress => {
      console.log(`progress: ${progress}`)
    })
    .onError(err => {
      console.log(`error: ${err}`)
    })

receptionist.load(monkey).load(ball)
// or
// receptionist.load([ monkey, ball ])

const animate = () => {
  controls.update()
  renderer.render(scene, camera)
}

const onWindowResize = () => {
  camera.aspect = window.innerWidth / window.innerHeight
  camera.updateProjectionMatrix()
  renderer.setSize(window.innerWidth, window.innerHeight)
}

window.addEventListener('resize', onWindowResize)

renderer.setAnimationLoop(animate)

API

new receptionist()

static createAsset

Create a new asset instance.

Receptionist.createAsset(url: string): Asset

static createLoader

新建加载器实例 Create a new loader instance.

Receptionist.createLoader(loader: THREE.Loader): Loader

static createInterceptor

Create a new interceptor instance.

Receptionist.createInterceptor(handler: HandlerIntercept): Interceptor

onLoad

Listening for the load completion messages for all assets.

type handlerLoad = (data: unknown) => void

onLoad(onLoad: handlerLoad): this

onProgress

Listening for the load progress messages for assets.

type handlerProgress = (progress: number) => void

onProgress(onProgress: handlerProgress): this

onError

Listening for the error messages for all assets.

type handlerError = (err: unknown) => void

onError(onError: handlerError): this

Asset API

onLoad

Listening for the load completion messages for this asset.

type handlerLoad = (data: unknown) => void

onLoad(onLoad: handlerLoad): this

onProgress

Listening for the load progress messages for this asset.

type handlerProgress = (progress: number) => void

onProgress(onProgress: handlerProgress): this

onError

Listening for the error messages for this asset.

type handlerError = (err: unknown) => void

onError(onError: handlerError): this

Loader API

bind

Bind assets. Use loaders in the loading process for these assets. Each asset should be bound with a loader.

bind(asset: Asset | Asset[]): this

Interceptor API

bind

Bind assets. Whether to use interceptors in the loading process for these assets.

bind(asset: Asset | Asset[]): this