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

autoprefixer-stylus

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoprefixer-stylus - npm Package Compare versions

Comparing version 0.14.0 to 1.0.0

.prettierrc

55

index.js

@@ -1,5 +0,5 @@

var ap = require('autoprefixer'),
postcss = require('postcss'),
map = require('multi-stage-sourcemap'),
path = require('path');
const autoprefixer = require('autoprefixer')
const postcss = require('postcss')
const map = require('multi-stage-sourcemap')
const path = require('path')

@@ -18,22 +18,21 @@ /**

module.exports = function(opts) {
if (!opts) { opts = {}; }
module.exports = function(opts = {}) {
// pull `hideWarnings` out so we can pass opts to autoprefixer
var showWarnings = !opts.hideWarnings;
delete opts.hideWarnings;
const showWarnings = !opts.hideWarnings
delete opts.hideWarnings
return function(style){
style = this || style;
var filename = style.options.filename;
return function(style) {
style = this || style
const filename = style.options.filename
style.on('end', function(err, css){
style.on('end', function(err, css) {
if (err) throw new Error(err)
// configure the options to be passed to autoprefixer
var process_opts = {
const processOpts = {
from: filename,
to: path.join(
path.dirname(filename),
path.basename(filename, path.extname(filename))
) + '.css'
to:
path.join(
path.dirname(filename),
path.basename(filename, path.extname(filename))
) + '.css'
}

@@ -43,29 +42,27 @@

if (style.sourcemap) {
process_opts.map = { annotation: false }
processOpts.map = { annotation: false }
}
// run autoprefixer
var res = postcss([ap(opts)]).process(css, process_opts);
var res = postcss([autoprefixer(opts)]).process(css, processOpts)
// if sourcemaps are generated, combine the two
if (res.map && style.sourcemap) {
var combined_map = map.transfer({
var combinedMap = map.transfer({
fromSourceMap: res.map.toString(),
toSourceMap: style.sourcemap
});
})
// then set the combined result as the new sourcemap
style.sourcemap = JSON.parse(combined_map);
style.sourcemap = JSON.parse(combinedMap)
}
if (showWarnings) {
res.warnings().forEach(console.error);
res.warnings().forEach(console.error)
}
// return the css output
return res.css;
});
return res.css
})
}
}
{
"name": "autoprefixer-stylus",
"description": "autoprefixer for stylus",
"version": "0.14.0",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/jescalan/autoprefixer-stylus.git"
"version": "1.0.0",
"author": "Jeff Escalante",
"dependencies": {
"autoprefixer": "9.6.1",
"multi-stage-sourcemap": "0.3.1",
"postcss": "7.0.17"
},
"devDependencies": {
"chai": "3.5.0",
"coffee-script": "1.12.6",
"coveralls": "2.13.1",
"chai": "4.2.0",
"coveralls": "3.0.5",
"css-parse": "2.0.0",
"istanbul": "0.4.5",
"mocha": "3.4.1",
"mocha-lcov-reporter": "1.3.0",
"mocha": "6.2.0",
"nyc": "^14.1.1",
"rimraf": "^2.6.3",
"stylus": "0.54.5"
},
"author": "Jeff Escalante",
"license": "MIT",
"main": "index.js",
"repository": "https://github.com/jescalan/autoprefixer-stylus",
"scripts": {
"test": "mocha",
"coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"coverage": "istanbul cover _mocha --report html -- -R spec && open coverage/index.html"
},
"engines": {
"node": ">= 4"
},
"dependencies": {
"autoprefixer": "7.1.0",
"multi-stage-sourcemap": "0.2.1",
"postcss": "6.0.1"
"coverage": "nyc report --reporter=html && open coverage/index.html",
"coveralls": "nyc report --reporter=text-lcov | coveralls && rimraf ./coverage",
"test": "nyc mocha"
}
}
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