Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

jstransformer-postcss

Package Overview
Dependencies
Maintainers
7
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstransformer-postcss - npm Package Compare versions

Comparing version
0.3.0
to
0.4.0
+10
-7
HISTORY.md

@@ -0,20 +1,23 @@

# Changelog
## 0.4.0 - 2015-08-05
- update boilerplate
## v0.3.0 / April 22, 2015
## 0.3.0 - 2015-04-22
- publish v0.3.0 to npm
- add support for `options.plugins`
## v0.2.1 / April 10, 2015
## 0.2.1 - 2015-04-10
- publish v0.2.1 to npm
- add `inputFormats`
## v0.2.0 / April 10, 2015
## 0.2.0 - 2015-04-10
- publish v0.2.0 to npm
- refactor
## v0.1.1 / April 3, 2015
## 0.1.1 - 2015-04-3
- publish v0.1.1 to npm
- add .renderFile method
## v0.1.0 / April 3, 2015
## 0.1.0 - 2015-04-3
- publish v0.1.0 to npm

@@ -24,3 +27,3 @@ - add related

## v0.0.0 / April 3, 2015
- first commits / publish v0.0.0 to npm
## 0.0.0 - 2015-04-3
- first commits / publish v0.0.0 to npm

@@ -1,8 +0,1 @@

/**
* jstransformer-postcss <https://github.com/tunnckoCore/jstransformer-postcss>
*
* Copyright (c) 2015 Charlike Mike Reagent, contributors.
* Released under the MIT license.
*/
'use strict';

@@ -13,29 +6,14 @@

exports.name = 'postcss';
exports.inputFormats = ['css', 'postcss'];
exports.inputFormats = ['postcss', 'css'];
exports.outputFormat = 'css';
exports.render = function _render(str, options) {
options = typeof options === 'object' ? options : {};
options.plugins = arrayify(options.plugins);
exports.render = function (str, opts) {
opts = opts && typeof opts === 'object' ? opts : {};
opts.plugins = opts.plugins && opts.plugins.length ? arrayify(opts.plugins) : []
var result = postcss(options.plugins).process(str, options);
return JSON.stringify({
root: result.root,
opts: result.opts,
css: result.css
});
return postcss(opts.plugins).process(str, opts).css
};
/**
* arrayify value
*
* @param {*} `val`
* @return {Array}
* @api private
*/
function arrayify(val) {
return !Array.isArray(val)
? [val]
: val;
function arrayify (val) {
return !Array.isArray(val) ? [val] : val;
}

@@ -1,22 +0,21 @@

Copyright (c) 2015 [Charlike Make Reagent](http://j.mp/1stW47C), contributors
# The MIT License (MIT)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Copyright (c) 2015 [JSTransformers Team](https://github.com/orgs/jstransformers/people)
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
{
"name": "jstransformer-postcss",
"version": "0.3.0",
"description": "PostCSS support for JS Transformers. CSS to CSS transformation.",
"scripts": {
"test": "node test",
"test-cov": "istanbul cover test",
"test-travis": "istanbul cover test --report lcovonly"
},
"author": {
"name": "Charlike Mike Reagent",
"email": "mameto_100@mail.bg",
"url": "https://github.com/tunnckoCore"
},
"repository": {
"type": "git",
"url": "git://github.com/jstransformers/jstransformer-postcss.git"
},
"version": "0.4.0",
"description": "PostCSS support for JSTransformers.",
"keywords": [
"css",
"engine",
"jstransformer",
"post",
"postcss",
"pre",
"processors",
"rework",
"template",
"transform"
],
"license": {
"type": "MIT",
"url": "https://github.com/jstransformers/jstransformer-postcss/blob/master/LICENSE.md"
"files": [
"index.js"
],
"devDependencies": {
"test-jstransformer": "^1.0.0"
},
"scripts": {
"coverage": "test-jstransformer coverage",
"test": "test-jstransformer"
},
"repository": {
"type": "git",
"url": "https://github.com/jstransformers/jstransformer-postcss.git"
},
"author": {
"name": "JSTransformers Team",
"url": "http://github.com/orgs/jstransformers/people"
},
"license": "MIT",
"dependencies": {
"postcss": "~4.1.4"
},
"devDependencies": {
"assertit": "^0.1.0",
"istanbul-harmony": "~0.3.1",
"lost": "~6.0.1",
"postcss-nested": "~0.2.2"
"postcss": "^4.1.16"
}
}
+17
-59

@@ -1,69 +0,27 @@

## [![npm][npmjs-img]][npmjs-url] [![mit license][license-img]][license-url] [![build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![deps status][daviddm-img]][daviddm-url]
# jstransformer-postcss
> [PostCSS][postcss] support for JS Transformers. CSS to CSS transformation.
[PostCSS](https://github.com/postcss/postcss) support for [JSTransformers](http://github.com/jstransformers).
## Install
[![Build Status](https://img.shields.io/travis/jstransformers/jstransformer-postcss/master.svg)](https://travis-ci.org/jstransformers/jstransformer-postcss)
[![Coverage Status](https://img.shields.io/coveralls/jstransformers/jstransformer-postcss/master.svg)](https://coveralls.io/r/jstransformers/jstransformer-postcss?branch=master)
[![Dependency Status](https://img.shields.io/david/jstransformers/jstransformer-postcss/master.svg)](http://david-dm.org/jstransformers/jstransformer-postcss)
[![NPM version](https://img.shields.io/npm/v/jstransformer-postcss.svg)](https://www.npmjs.org/package/jstransformer-postcss)
## Installation
```
npm i --save jstransformer-postcss
npm test
npm install jstransformer-postcss
```
## API
## Usage
> For more use-cases see the [tests](./test/index.js)
```js
var postcss = require('jstransformer')(require('jstransformer-postcss'))
```js
var postcss = require('jstransformer')(require('jstransformer-postcss'));
postcss.render('div.foo { width: 100%; }').body
//=> 'div.foo { width: 100%; }'
```
## License
## Related
- [jstransformer](https://github.com/jstransformers/jstransformer): Normalize the API of any jstransformer
- [jstransformer-myth](https://github.com/jstransformers/jstransformer-myth): Myth support for JS Transformers
- [jstransformer-styl](https://github.com/jstransformers/jstransformer-styl): JSTransformer support for styl.
- [jstransformer-stylus](https://github.com/jstransformers/jstransformer-stylus): Transform stylus into css
- [jstransformer-rework](https://github.com/jstransformers/jstransformer-rework): ReworkCSS support for JS Transformers. CSS to CSS transformation.
- [cssom](https://github.com/NV/CSSOM): CSS Object Model implementation and CSS parser
- [css](https://github.com/reworkcss/css): CSS parser / stringifier
- [rework](https://github.com/reworkcss/rework): Plugin framework for CSS preprocessing
- [postcss](https://github.com/postcss/postcss): Tool for transforming CSS with JS plugins
- [myth](https://github.com/segmentio/myth): A CSS preprocessor that acts like a polyfill for future versions of the spec.
- [styl](https://github.com/tj/styl): CSS pre-processor built on Rework
- [stylus](https://github.com/LearnBoost/stylus): Robust, expressive, and feature-rich CSS superset
## License [![MIT license][license-img]][license-url]
Copyright (c) 2015 [JSTransformers][jstransformers-url], [Charlike Mike Reagent][contrib-more], [contributors][contrib-graf].
Released under the [`MIT`][license-url] license.
[jstransformers-url]: https://github.com/jstransformers
[npmjs-url]: http://npm.im/jstransformer-postcss
[npmjs-img]: https://img.shields.io/npm/v/jstransformer-postcss.svg?style=flat&label=jstransformer-postcss
[coveralls-url]: https://coveralls.io/r/jstransformers/jstransformer-postcss?branch=master
[coveralls-img]: https://img.shields.io/coveralls/jstransformers/jstransformer-postcss.svg?style=flat
[license-url]: https://github.com/jstransformers/jstransformer-postcss/blob/master/LICENSE.md
[license-img]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat
[travis-url]: https://travis-ci.org/jstransformers/jstransformer-postcss
[travis-img]: https://img.shields.io/travis/jstransformers/jstransformer-postcss.svg?style=flat
[daviddm-url]: https://david-dm.org/jstransformers/jstransformer-postcss
[daviddm-img]: https://img.shields.io/david/jstransformers/jstransformer-postcss.svg?style=flat
[author-gratipay]: https://gratipay.com/tunnckoCore
[author-twitter]: https://twitter.com/tunnckoCore
[author-github]: https://github.com/tunnckoCore
[author-npmjs]: https://npmjs.org/~tunnckocore
[contrib-more]: http://j.mp/1stW47C
[contrib-graf]: https://github.com/jstransformers/jstransformer-postcss/graphs/contributors
[postcss]: https://github.com/postcss/postcss
***
_Proudly generated by [docks(1)](https://github.com/tunnckoCore), April 10, 2015_
MIT
# .editorconfig <https://github.com/tunnckoCore/dotfiles>
#
# Copyright (c) 2015 Charlike Mike Reagent, contributors.
# Released under the MIT license.
#
root = true
[*]
indent_style = space
charset = utf-8
end_of_line = lf
insert_final_newline = false
trim_trailing_whitespace = false
[*.{js,php}]
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.{php,html}]
indent_size = 4
[*.{json,cson,yml,yaml,html,md,jade,css,stylus}]
indent_size = 2
[Makefile]
indent_size = 2
indent_style = tab
[.*rc]
indent_size = 2
indent_style = space
trim_trailing_whitespace = true

Sorry, the diff of this file is not supported yet

sudo: false
language: node_js
node_js:
- "iojs"
- "0.10"
- "0.12"
script: "npm run-script test-travis"
after_script: "npm install coveralls && cat ./coverage/lcov.info | coveralls"
.phone_title {
width: 500px
}
@media (max-width: 500px) {
.phone_title {
width: auto
}
}
body.is_dark .phone_title {
color: white;
}
.phone img {
display: block;
}

Sorry, the diff of this file is not supported yet

.phone {
&_title {
width: 500px;
@media (max-width: 500px) {
width: auto;
}
body.is_dark & {
color: white;
}
}
img {
display: block;
}
}

Sorry, the diff of this file is not supported yet

/**
* jstransformer-postcss <https://github.com/tunnckoCore/jstransformer-postcss>
*
* Copyright (c) 2015 Charlike Mike Reagent, contributors.
* Released under the MIT license.
*/
'use strict';
var fs = require('fs');
var test = require('assertit');
var transform = require('../index');
// plugins
var lost = require('lost')
var nested = require('postcss-nested');
test('should transform nested CSS with PostCSS (.render)', function(done) {
var fixture = fs.readFileSync('./test/fixture.css', 'utf8');
var data = transform.render(fixture, {plugins: nested});
var actual = JSON.parse(data).css;
var expected = fs.readFileSync('./test/expected.css', 'utf8');
test.equal(actual, expected);
done();
});
test('should transform future CSS (LostGrid) with PostCSS (.render)', function(done) {
var fixture = fs.readFileSync('./test/fixture.lost', 'utf8');
var data = transform.render(fixture, {plugins: [lost()]});
var actual = JSON.parse(data).css;
var expected = fs.readFileSync('./test/expected.lost', 'utf8');
test.equal(actual, expected);
done();
});