New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stylus-supremacy

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylus-supremacy

Make your Stylus files look great again.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
decreased by-14.64%
Maintainers
1
Weekly downloads
 
Created
Source

Stylus Supremacy

Stylus Supremacy is a Node.js script for formatting Stylus files. You may say this is a beautifier of Stylus.

Basic usage

First thing first, you must install this script via NPM by calling npm install stylus-supremacy -g, then calling the below command.

node stylus-supremacy ./path/to/your/file.styl

In case you want to format multiple files at a time, you can specify a file path in glob pattern.

node stylus-supremacy ./**/*.styl

Formatting options

The default formatting options will be used, unless you specify your own options explicitly. The parameter --options and -p can be used interchangably.

node stylus-supremacy ./path/to/your/file.styl --options ./path/to/your/options.json
OptionsDefault valuePossible values
insertColonstruetrue for always inserting a colon after a property name, otherwise false.
insertSemicolonstruetrue for always inserting a semi-colon after a property value, a variable declaration, a variable assignment and a function call, otherwise false.
insertBracestruetrue for always inserting a pair of curly braces between a selector body, a mixin body, a function body and any @-block bodies, otherwise false.
insertNewLineBetweenGroups1This represents a number of new-line between different type of groups.
insertNewLineBetweenSelectorsfalsetrue for always inserting a new-line between selectors, otherwise false.
insertNewLineBeforeElsefalsetrue for always inserting a new-line before else keyword, otherwise false.
insertSpaceBeforeCommenttruetrue for always inserting a white-space before a comment, otherwise false.
insertSpaceAfterCommenttruetrue for always inserting a white-space after a comment, otherwise false.
insertParenthesisAroundIfConditiontruetrue for always inserting a pair of parentheses between if-condition, otherwise false.
tabStopChar\tThis represents a tab-stop string. You may change this to 2-white-space sequence or anything.
newLineChar\nThis represents a new-line character. You may change this to \r\n if you are using Microsoft Windows.
quoteChar'This represents a quote character that is used to begin and terminate a string. You must choose either single-quote or double-quote.
sortPropertiesfalsefalse for doing nothing about the CSS property order. alphabetical for sorting CSS properties from A to Z. grouped for sorting CSS properties according to Stylint.
alwaysUseImportfalsetrue for always using @import over @require. The difference between @import and @require is very subtle. Please refer to the offical guide.
alwaysUseNotfalsetrue for always using not keyword over ! operator, otherwise false.

Writing the formatted output to a file

Normally, running the command will print out the formatted content to the output stream (console). However, you may write the formatted content to a file (or many files, if the pattern matches more than one files) by specifying --outDir or -o, and followed by the path to an output directory.

node stylus-supremacy ./path/to/your/file.styl --outDir ./path/to/output/directory

Alternatively, you may overwrite the original file with the formatted output by specifying --replace or -r parameter.

node stylus-supremacy ./path/to/your/file.styl --replace

Note that --outDir and --replace will not work together. You have to choose just one.

Using this as an NPM module

Simply include stylus-supremacy/edge/format and call it with Stylus content as a string and formatting options as an object (see above topic).

const format = require('stylus-supremacy/edge/format')

const stylus = `
body
  display none
`

const options = {
  insertColons: true,
  insertSemicolons: true,
  insertBraces: true
}

console.log(format(stylus, options))

The stream output prints:

body {
  display: none;
}

FAQs

Package last updated on 08 Apr 2017

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