Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glslify-deps

Package Overview
Dependencies
Maintainers
19
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glslify-deps

Walk the dependency graph of a glslify shader.

  • 1.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
174K
decreased by-28.69%
Maintainers
19
Weekly downloads
 
Created

What is glslify-deps?

The glslify-deps npm package is a tool for analyzing and resolving dependencies in GLSL (OpenGL Shading Language) files. It is particularly useful for managing and bundling shader code in web applications, allowing developers to modularize their GLSL code and include external libraries.

What are glslify-deps's main functionalities?

Dependency Analysis

This feature allows you to analyze the dependencies of a GLSL file. The code sample demonstrates how to use glslify-deps to parse a shader code string, add it to the dependency tree, and then output the dependency tree.

const glslifyDeps = require('glslify-deps');
const deps = glslifyDeps();

const shaderCode = `
#pragma glslify: noise = require(glsl-noise/simplex/2d)

void main() {
  float n = noise(gl_FragCoord.xy);
  gl_FragColor = vec4(vec3(n), 1.0);
}`;

deps.add(shaderCode, 'shader.glsl');

console.log(deps.tree());

Resolving Dependencies

This feature allows you to resolve and bundle all dependencies into a single GLSL file. The code sample shows how to add a shader code string to the dependency tree and then resolve all dependencies, outputting the bundled shader code.

const glslifyDeps = require('glslify-deps');
const deps = glslifyDeps();

const shaderCode = `
#pragma glslify: noise = require(glsl-noise/simplex/2d)

void main() {
  float n = noise(gl_FragCoord.xy);
  gl_FragColor = vec4(vec3(n), 1.0);
}`;

deps.add(shaderCode, 'shader.glsl');

deps.resolve((err, src) => {
  if (err) throw err;
  console.log(src);
});

Other packages similar to glslify-deps

FAQs

Package last updated on 25 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc