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

@leonardorick/three

v1.0.78

Published

Utils Three.js function from Leonardo Rick

Downloads

38

Readme

lthree

Javascript utility functions for handling three.js stuff

usage

`pnpm i @leonardorick/three`

on plain javascript

import lthree from './node_modules/@leonardorick/three/index.js';

on a modern JS application working with bundlers

import lthree from '@leoanrdorick/three';

publish

npm run deploy

add new functions

If you are going to add a new "module" (file) make sure to keep the same structure present on the project. The following three folders should have (almost) the same structure:

  1. src/ Where the .js file is located and the function is actually implemented. This function should be imported inside src/index.js, which is the only file that is not repeated on the other folders. This file abastracts the complexity of the actual index.js outside the src folder that import stuff from './dist' and we don't want to keep updating it everytime.

    Make sure to add some JSDocs one each function explaining it usage

  2. tests/ Any function should have at least one test for it implementation. Preferably the module will have more than one test per function implement to contemplate multiple scenarios

  3. types/ The signature of the exported classes/functions should be present on types/ as a .d.ts file. This file should also be imported on the types/index.d.ts so all types of the exported package members can be properly infered by IDE's

Try to make the functions inside each module ordered alphabetically as much as possible!

Code patterns

Optional parameters: Usually optional parameters are the last param of the function and are inside a object with default values.

funciton something(a, {
  opt1 = true,
  opt2 = null,
  opt3 = 5,
} = {})

internal imports: If some module imports another one internally it needs to import it with the extension. This allows the builded version to work as expected

import { hypotenuse, round } from './math.js'; // right
//...
import { hypotenuse, round } from './math'; // wrong