Installations
npm install three
Developer Guide
Typescript
No
Module System
ESM
Node Version
18.13.0
NPM Version
9.6.2
Score
67.6
Supply Chain
94.9
Quality
90.6
Maintenance
100
Vulnerability
93.3
License
Releases
Contributors
Languages
JavaScript (58.89%)
HTML (34.7%)
Roff (2.58%)
SCSS (2.46%)
CSS (1.36%)
Developer
Download Statistics
Total Downloads
199,453,446
Last Day
72,673
Last Week
1,430,220
Last Month
6,007,114
Last Year
67,237,448
GitHub Statistics
103,408 Stars
44,639 Commits
35,452 Forks
2,546 Watching
13 Branches
1,949 Contributors
Bundle Size
687.71 kB
Minified
167.94 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.171.0
Package Id
three@0.171.0
Unpacked Size
24.34 MB
Size
6.41 MB
File Count
1,086
NPM Version
9.6.2
Node Version
18.13.0
Publised On
29 Nov 2024
Total Downloads
Cumulative downloads
Total Downloads
199,453,446
Last day
-11.6%
72,673
Compared to previous day
Last week
-3.1%
1,430,220
Compared to previous week
Last month
-8.3%
6,007,114
Compared to previous month
Last year
26.2%
67,237,448
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
three.js
JavaScript 3D library
The aim of the project is to create an easy-to-use, lightweight, cross-browser, general-purpose 3D library. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available as addons.
Examples — Docs — Manual — Wiki — Migrating — Questions — Forum — Discord
Usage
This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL
renderer for the scene and camera, and it adds that viewport to the document.body
element. Finally, it animates the cube within the scene for the camera.
1import * as THREE from 'three'; 2 3const width = window.innerWidth, height = window.innerHeight; 4 5// init 6 7const camera = new THREE.PerspectiveCamera( 70, width / height, 0.01, 10 ); 8camera.position.z = 1; 9 10const scene = new THREE.Scene(); 11 12const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 ); 13const material = new THREE.MeshNormalMaterial(); 14 15const mesh = new THREE.Mesh( geometry, material ); 16scene.add( mesh ); 17 18const renderer = new THREE.WebGLRenderer( { antialias: true } ); 19renderer.setSize( width, height ); 20renderer.setAnimationLoop( animate ); 21document.body.appendChild( renderer.domElement ); 22 23// animation 24 25function animate( time ) { 26 27 mesh.rotation.x = time / 2000; 28 mesh.rotation.y = time / 1000; 29 30 renderer.render( scene, camera ); 31 32}
If everything goes well, you should see this.
Cloning this repository
Cloning the repo with all its history results in a ~2 GB download. If you don't need the whole history you can use the depth
parameter to significantly reduce download size.
1git clone --depth=1 https://github.com/mrdoob/three.js.git
Change log
Stable Version
Stable Version
0.171.0
HIGH
2
7.5/10
Summary
Denial of service in three
Affected Versions
< 0.125.0
Patched Versions
0.125.0
7.1/10
Summary
Cross site scripting in three.js
Affected Versions
< 0.137.0
Patched Versions
0.137.0
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
30 commit(s) and 21 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
SAST tool is run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Info: all commits (23) are checked with a SAST tool
Reason
all dependencies are pinned
Details
- Info: 21 out of 21 GitHub-owned GitHubAction dependencies pinned
- Info: 2 out of 2 third-party GitHubAction dependencies pinned
- Info: 6 out of 6 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-code-scanning.yml:18
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-code-scanning.yml:19
- Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:11
- Warn: no topLevel permission defined: .github/workflows/codeql-code-scanning.yml:1
- Info: topLevel 'contents' permission set to 'read': .github/workflows/read-size.yml:15
- Info: no jobLevel write permissions found
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
Reason
binaries present in source code
Details
- Warn: binary detected: examples/jsm/libs/ammo.wasm.wasm:1
- Warn: binary detected: examples/jsm/libs/basis/basis_transcoder.wasm:1
- Warn: binary detected: examples/jsm/libs/draco/draco_decoder.wasm:1
- Warn: binary detected: examples/jsm/libs/draco/gltf/draco_decoder.wasm:1
- Warn: binary detected: examples/jsm/libs/rhino3dm/rhino3dm.wasm:1
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'dev'
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
6.7
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More