
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
nmf-webpack-loader
Advanced tools
This loader parses your .nmf file, searches for "url" occurences, copies
the assets into the output directory, replaces the url with the outputted path,
recompiles the .nmf JSON structure and returns a data url (e.g. data:application/x-pnacl,{"program":...
).
npm install nmf-loader --save-dev
webpack config:
module.exports = {
module: {
loaders: [{
test: /\.nmf$/,
loader: 'nmf',
query: {
name: '[name].[hash:6].[ext]'
}
}, {
test: /\.((nexe)|(pexe)|(so))$/, // will load .nexe, .pexe and .so files with file-loader
loader: 'file-loader',
query: {
name: '[name].[hash:6].[ext]'
}
}]
},
};
Example .nmf file, my-nativeclient.nmf
:
{
"program": {
"portable": {
"pnacl-translate": {
"url": "./my-native-app.pexe"
}
}
}
}
In your application:
const nmf = require('./my-nativeclient.nmf');
const embed = document.createElement('embed');
embed.setAttribute('src', nmf);
embed.setAttribute('width', 0);
embed.setAttribute('height', 0);
embed.setAttribute('type', 'application/x-pnacl');
document.body.appendChild(embed);
The loader replaces every occurence of {"url": "[some nacl file url]"}
with the actual URL of the file, including public path and/or a hash in the filename. The NaCl file will also be copied into the project's output directory.
npm test
Apache 2.0
FAQs
A Webpack loader for Native Client manifests
The npm package nmf-webpack-loader receives a total of 17 weekly downloads. As such, nmf-webpack-loader popularity was classified as not popular.
We found that nmf-webpack-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.