Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
glsl-token-inject-block
Advanced tools
Injects a "block" of GLSL tokens into a shader, after any #version
, #extension
and precision
statements. This will pad the new tokens with the necessary amount of newlines (but no more).
This module ignores token line
, column
and position
.
Your source:
var tokenizer = require('glsl-tokenizer')
var inject = require('glsl-token-inject-block')
var stringify = require('glsl-token-string')
var tokens = tokenizer(shaderInput)
var newToken = {
type: 'preprocessor',
data: '#define FOOBAR'
}
var source = stringify(inject(tokens, newToken))
console.log(source)
The following shader input:
// some comment
#version 300 es
#extension SOME_EXTENSION : enable
void main() {}
Results in the following injected define:
// some comment
#version 300 es
#extension SOME_EXTENSION : enable
#define FOOBAR
void main() {}
tokens = inject(tokens, newTokens)
For the given shader source (tokens
), injects newTokens
into them, assuming the new tokens are a "block" of code that should be placed on its own line.
newTokens
can be a single token object, or an array of token objects.
Modifies tokens
in place and returns it.
MIT, see LICENSE.md for details.
FAQs
safely inject a block of tokens into a shader
The npm package glsl-token-inject-block receives a total of 187,642 weekly downloads. As such, glsl-token-inject-block popularity was classified as popular.
We found that glsl-token-inject-block demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.