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

eyeglass-file-text

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eyeglass-file-text

Sass eyeglass module for getting the contents of text or binary files as (encoded) string.

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
244
decreased by-4.69%
Maintainers
1
Weekly downloads
 
Created
Source

eyeglass-file-text

Sass eyeglass module for getting the contents of text or binary files as (encoded) string.

New: Supports binary files now (encodes to base64).

New: Normalizes line endings to prevent issues with quotes and later output of the string.

Installation

npm install --save-dev eyeglass-file-text

Usage

@import 'file-text';

// Fetch text file:
$text  : file-text('./loremipsum.txt');
    // encoding can be explicitly specified by 2nd argument

// Fetch binary file:
$base64: file-binary('./test.jpg');
    // binary file content is represented as base64 text


// The string can then be used as usual in sass:
.test-text {
  content: $text;
}

.test-binary {
  background: url("data:image/jpeg;base64,#{$base64}");
}

Arguments

file-text

path

Path to the file.

encoding

Encoding of the file. Defaults to utf8.

file-binary

path

Path to the file.

Keywords

FAQs

Package last updated on 25 Sep 2015

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