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

electron-stylus

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-stylus

A dead simple Stylus loader for Electron app

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Electron Stylus

A dead simple Stylus loader for Electron app

This module is on working... take care if you want to use in Production.

How to

Install it with NPM.

npm install -S electron-stylus

Use it in your HTML file.

<script>
require('electron-stylus')(__dirname + '/path/to/stylus.styl')
</script>

It will return a Promise with css string.

require('electron-stylus')(__dirname + '/path/to/stylus.styl')
  .then(function (css) {
    console.log(css)
    console.log('successfully loaded')
  })

Example code also included. I hope you to enjoy.

Go scratch

Install stylus

npm install -S stylus

Write this code in your HTML file.

<script>
var stylus = require('stylus')
var str = require('fs').readFileSync(__dirname + '/../styles/main/index.styl', 'utf8')

stylus(str)
  .set('filename', __dirname + '/../styles/main/index.styl', 'utf8')
  .render(function(err, css){
    if (err) throw err
      var style = document.createElement('style')
      style.innerText = css
      style.type = 'text/css'
      document.head.appendChild(style)
  })
</script>

License

ISC License (ISC)

Copyright (c) 2015, Dick Choi

Keywords

FAQs

Package last updated on 30 Jul 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