Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@parcel/transformer-raw
Advanced tools
@parcel/transformer-raw is a transformer plugin for Parcel, a web application bundler. This plugin allows you to import raw content from files as strings. It is particularly useful for importing non-code assets like text files, HTML, or any other file types that you want to include as raw strings in your JavaScript code.
Importing raw content from text files
This feature allows you to import the content of a text file as a string. The 'bundle-text:' prefix tells Parcel to use the @parcel/transformer-raw plugin to handle the import.
import rawContent from 'bundle-text:./example.txt';
console.log(rawContent);
Importing raw content from HTML files
Similar to importing text files, this feature allows you to import the content of an HTML file as a string. This can be useful for embedding HTML templates directly into your JavaScript code.
import rawHtml from 'bundle-text:./example.html';
console.log(rawHtml);
Importing raw content from any file type
This feature demonstrates the flexibility of @parcel/transformer-raw by allowing you to import raw content from any file type, not just text or HTML. This can be useful for custom file types or binary data.
import rawData from 'bundle-text:./example.xyz';
console.log(rawData);
raw-loader is a loader for webpack that imports files as strings. It serves a similar purpose to @parcel/transformer-raw but is designed for use with webpack instead of Parcel. Both plugins allow you to import raw content from files, but they are specific to their respective bundlers.
file-loader is another webpack loader that can be used to import files. Unlike raw-loader and @parcel/transformer-raw, file-loader emits the file into the output directory and returns the URL to the file. This is useful for handling assets like images, fonts, and other binary files.
url-loader is a webpack loader that works similarly to file-loader but can also inline files as base64 URIs if they are below a specified size. This can be useful for optimizing the loading of small assets. While it doesn't import raw content as strings, it provides a different approach to handling file imports.
FAQs
Unknown package
The npm package @parcel/transformer-raw receives a total of 270,810 weekly downloads. As such, @parcel/transformer-raw popularity was classified as popular.
We found that @parcel/transformer-raw demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.