Giter Site home page Giter Site logo

clean-css-cli's Introduction


clean-css logo

NPM version x86 Linux build Dependency Status NPM Downloads

clean-css-cli is a command-line interface to clean-css - fast and efficient CSS optimizer for Node.js.

Previously a part of clean-css it's a separate package since clean-css 4.0.

IMPORTANT: clean-css-cli is now in a maintenance mode. PRs are still welcome, and I will try do an occasional bugfix relase.

Table of Contents

Node.js version support

clean-css-cli requires Node.js 10.0+ (tested on Linux)

Install

npm install clean-css-cli -g

Note: Global install via -g option is recommended unless you want to execute the binary via a relative path, i.e. ./node_modules/.bin/cleancss

Use

cleancss -o one.min.css one.css

What's new in version 5.5

clean-css-cli 5.5 introduces the following changes / features:

  • adds a new --watch switch, which makes cleancss re-run optimizations when watched file(s) change.

What's new in version 5.1

clean-css-cli 5.1 introduces the following changes / features:

  • accept !path/to/file as a way of telling cleancss to ignore such file, also accepts any available glob patterns.

What's new in version 5.0

clean-css-cli 5.0 introduces the following changes / features:

  • adds --batch option (off by default) which processes input files one by one without joining them together;
  • adds --batch-suffix option to specify what gets appended to output filename in batch mode;
  • automatically creates missing output directories;
  • clean-css 5.0 with loads of bugfixes;
  • drops official support for Node.js 4, 6, and 8;
  • --skip-rebase option has been removed as rebasing URLs is disabled by default now
  • --with-rebase option is added if you really want URLs rebasing

What's new in version 4.3

clean-css-cli 4.3 introduces the following changes / features:

  • --input-source-map option which accepts a path to input source map file.

What's new in version 4.2

clean-css-cli 4.2 introduces the following changes / features:

What's new in version 4.1

clean-css-cli 4.1 introduces the following changes / features:

  • clean-css 4.1 as a dependency;
  • --remove-inlined-files option for removing files inlined in <source-file ...> or via @import statements;
  • adds glob pattern matching to source paths, see example;
  • allows non-boolean compatibility options, e.g. --compatibility selectors.mergeLimit=512;
  • extracts CLI into an importable module, so it can be reused and enhanced if needed;
  • adds beforeMinify callback as a second argument to CLI module, see example use case.

What's new in version 4.0

clean-css-cli 4.0 introduces some breaking changes:

  • API and CLI interfaces are split, so CLI has been moved to this repository while API stays at clean-css;
  • --root and --relativeTo options are replaced by a single option taken from --output path - this means that rebasing URLs and import inlining is much simpler but may not be (YMMV) as powerful as in 3.x;
  • --rounding-precision is disabled by default;
  • --rounding-precision applies to all units now, not only px as in 3.x;
  • --skip-import and --skip-import-from are merged into --inline option which defaults to local. Remote @import rules are NOT inlined by default anymore;
  • renames --timeout option to --inline-timeout;
  • remote resources without a protocol, e.g. //fonts.googleapis.com/css?family=Domine:700, are not inlined anymore;
  • changes default Internet Explorer compatibility from 9+ to 10+, to revert the old default use --compatibility ie9 option;
  • moves --rounding-precision, --s0, and --s1 options to level 1 optimization options, see examples;
  • moves --skip-media-merging, --skip-restructuring, --semantic-merging, and --skip-shorthand-compacting to level 2 optimizations options, see examples below;
  • level 1 optimizations are the new default, up to 3.x it was level 2;
  • --keep-breaks option is replaced with --format keep-breaks to ease transition;
  • --skip-aggressive-merging option is removed as aggressive merging is replaced by smarter override merging.

CLI options

-b, --batch                    If enabled, optimizes input files one by one instead of joining them together
-c, --compatibility [ie7|ie8]  Force compatibility mode (see Readme for advanced examples)
-d, --debug                    Shows debug information (minification time & compression efficiency)
-f, --format <options>         Controls output formatting, see examples below
-h, --help                     output usage information
-o, --output [output-file]     Use [output-file] as output instead of STDOUT
-O <n> [optimizations]         Turn on level <n> optimizations; optionally accepts a list of fine-grained options, defaults to `1`, IMPORTANT: the prefix is O (a capital o letter), NOT a 0 (zero, a number)
-v, --version                  output the version number
--inline [rules]               Enables inlining for listed sources (defaults to `local`)
--inline-timeout [seconds]     Per connection timeout when fetching remote stylesheets (defaults to 5 seconds)
--input-source-map [file]      Specifies the path of the input source map file
--remove-inlined-files         Remove files inlined in <source-file ...> or via `@import` statements
--source-map                   Enables building input's source map
--source-map-inline-sources    Enables inlining sources inside source maps
--with-rebase                  Enables URLs rebasing

Compatibility modes

There is a certain number of compatibility mode shortcuts, namely:

  • --compatibility '*' (default) - Internet Explorer 10+ compatibility mode
  • --compatibility ie9 - Internet Explorer 9+ compatibility mode
  • --compatibility ie8 - Internet Explorer 8+ compatibility mode
  • --compatibility ie7 - Internet Explorer 7+ compatibility mode

Each of these modes is an alias to a fine grained configuration, with the following options available:

cleancss --compatibility '*,-properties.urlQuotes'
cleancss --compatibility '*,+properties.ieBangHack,+properties.ieFilters'
# [+-]colors.opacity controls `rgba()` / `hsla()` color support; defaults to `on` (+)
# [+-]properties.backgroundClipMerging controls background-clip merging into shorthand; defaults to `on` (+)
# [+-]properties.backgroundOriginMerging controls background-origin merging into shorthand; defaults to `on` (+)
# [+-]properties.backgroundSizeMerging controls background-size merging into shorthand; defaults to `on` (+)
# [+-]properties.colors controls color optimizations; defaults to `on` (+)
# [+-]properties.ieBangHack controls keeping IE bang hack; defaults to `off` (-)
# [+-]properties.ieFilters controls keeping IE `filter` / `-ms-filter`; defaults to `off` (-)
# [+-]properties.iePrefixHack controls keeping IE prefix hack; defaults to `off` (-)
# [+-]properties.ieSuffixHack controls keeping IE suffix hack; defaults to `off` (-)
# [+-]properties.merging controls property merging based on understandability; defaults to `on` (+)
# [+-]properties.shorterLengthUnits controls shortening pixel units into `pc`, `pt`, or `in` units; defaults to `off` (-)
# [+-]properties.spaceAfterClosingBrace controls keeping space after closing brace - `url() no-repeat` cleancss --compatibility '*,into `url('roperties.no-repeat`; defaults to `on` (+)
# [+-]properties.urlQuotes controls keeping quoting inside `url()`; defaults to `off` (-)
# [+-]properties.zeroUnitsf units `0` value; defaults to `on` (+)
# [+-]selectors.adjacentSpace controls extra space before `nav` element; defaults to `off` (-)
# [+-]selectors.ie7Hack controls removal of IE7 selector hacks, e.g. `*+html...`; defaults to `on` (+)
# [+-]units.ch controls treating `ch` as a supported unit; defaults to `on` (+)
# [+-]units.in controls treating `in` as a supported unit; defaults to `on` (+)
# [+-]units.pc controls treating `pc` as a supported unit; defaults to `on` (+)
# [+-]units.pt controls treating `pt` as a supported unit; defaults to `on` (+)
# [+-]units.rem controls treating `rem` as a supported unit; defaults to `on` (+)
# [+-]units.vh controls treating `vh` as a supported unit; defaults to `on` (+)
# [+-]units.vm controls treating `vm` as a supported unit; defaults to `on` (+)
# [+-]units.vmax controls treating `vmax` as a supported unit; defaults to `on` (+)
# [+-]units.vmin controls treating `vmin` as a supported unit; defaults to `on` (+)

You can also chain more rules after a shortcut when setting a compatibility:

cleancss --compatibility 'ie9,-colors.opacity,-units.rem' one.css

Formatting options

The --format option accept the following options:

cleancss --format beautify one.css
cleancss --format keep-breaks one.css
cleancss --format 'indentBy:1;indentWith:tab' one.css
cleancss --format 'breaks:afterBlockBegins=on;spaces:aroundSelectorRelation=on' one.css
# `breaks` controls where to insert breaks
#   `afterAtRule` controls if a line break comes after an at-rule; e.g. `@charset`; defaults to `off` (alias to `false`)
#   `afterBlockBegins` controls if a line break comes after a block begins; e.g. `@media`; defaults to `off`
#   `afterBlockEnds` controls if a line break comes after a block ends, defaults to `off`
#   `afterComment` controls if a line break comes after a comment; defaults to `off`
#   `afterProperty` controls if a line break comes after a property; defaults to `off`
#   `afterRuleBegins` controls if a line break comes after a rule begins; defaults to `off`
#   `afterRuleEnds` controls if a line break comes after a rule ends; defaults to `off`
#   `beforeBlockEnds` controls if a line break comes before a block ends; defaults to `off`
#   `betweenSelectors` controls if a line break comes between selectors; defaults to `off`
# `breakWith` controls the new line character, can be `windows` or `unix` (aliased via `crlf` and `lf`); defaults to system one, so former on Windows and latter on Unix
# `indentBy` controls number of characters to indent with; defaults to `0`
# `indentWith` controls a character to indent with, can be `space` or `tab`; defaults to `space`
# `spaces` controls where to insert spaces
#   `aroundSelectorRelation` controls if spaces come around selector relations; e.g. `div > a`; defaults to `off`
#   `beforeBlockBegins` controls if a space comes before a block begins; e.g. `.block {`; defaults to `off`
#   `beforeValue` controls if a space comes before a value; e.g. `width: 1rem`; defaults to `off`
# `wrapAt` controls maximum line length; defaults to `off`

Inlining options

--inline option whitelists which @import rules will be processed, e.g.

cleancss --inline local one.css # default
cleancss --inline all # same as local,remote
cleancss --inline local,mydomain.example.com one.css
cleancss --inline 'local,remote,!fonts.googleapis.com' one.css

Optimization levels

The -O option can be either 0, 1 (default), or 2, e.g.

cleancss -O2 one.css

or a fine-grained configuration given via a string.

Please note that level 1 optimization options are generally safe while level 2 optimizations should be safe for most users.

Important: The -O option is using the capital letter O (as in "Oscar"), not the number zero.

Level 0 optimizations

Level 0 optimizations simply means "no optimizations". Use it when you'd like to inline imports and / or rebase URLs but skip everything else, e.g.

cleancss -O0 one.css

Level 1 optimizations

Level 1 optimizations (default) operate on single properties only, e.g. can remove units when not required, turn rgb colors to a shorter hex representation, remove comments, etc

Here is a full list of available options:

cleancss -O1 one.css
cleancss -O1 removeQuotes:off;roundingPrecision:4;specialComments:1 one.css
# `cleanupCharsets` controls `@charset` moving to the front of a stylesheet; defaults to `on`
# `normalizeUrls` controls URL normalzation; default to `on`
# `optimizeBackground` controls `background` property optimizatons; defaults to `on`
# `optimizeBorderRadius` controls `border-radius` property optimizatons; defaults to `on`
# `optimizeFilter` controls `filter` property optimizatons; defaults to `on`
# `optimizeFontWeight` controls `font-weight` property optimizatons; defaults to `on`
# `optimizeOutline` controls `outline` property optimizatons; defaults to `on`
# `removeEmpty` controls removing empty rules and nested blocks; defaults to `on` (since 4.1.0)
# `removeNegativePaddings` controls removing negative paddings; defaults to `on`
# `removeQuotes` controls removing quotes when unnecessary; defaults to `on`
# `removeWhitespace` controls removing unused whitespace; defaults to `on`
# `replaceMultipleZeros` contols removing redundant zeros; defaults to `on`
# `replaceTimeUnits` controls replacing time units with shorter values; defaults to `on
# `replaceZeroUnits` controls replacing zero values with units; defaults to `on`
# `roundingPrecision` rounds pixel values to `N` decimal places; `off` disables rounding; defaults to `off`
# `selectorsSortingMethod` denotes selector sorting method; can be `natural` or `standard`; defaults to `standard`
# `specialComments` denotes a number of /*! ... */ comments preserved; defaults to `all`
# `tidyAtRules` controls at-rules (e.g. `@charset`, `@import`) optimizing; defaults to `on`
# `tidyBlockScopes` controls block scopes (e.g. `@media`) optimizing; defaults to `on`
# `tidySelectors` controls selectors optimizing; defaults to `on`

There is an all shortcut for toggling all options at the same time, e.g.

cleancss -O1 'all:off;tidySelectors:on' one.css

Level 2 optimizations

Level 2 optimizations operate at rules or multiple properties level, e.g. can remove duplicate rules, remove properties redefined further down a stylesheet, or restructure rules by moving them around.

Please note that if level 2 optimizations are turned on then, unless explicitely disabled, level 1 optimizations are applied as well.

Here is a full list of available options:

cleancss -O2 one.css
cleancss -O2 mergeMedia:off;restructureRules:off;mergeSemantically:on;mergeIntoShorthands:off one.css
# `mergeAdjacentRules` controls adjacent rules merging; defaults to `on`
# `mergeIntoShorthands` controls merging properties into shorthands; defaults to `on`
# `mergeMedia` controls `@media` merging; defaults to `on`
# `mergeNonAdjacentRules` controls non-adjacent rule merging; defaults to `on`
# `mergeSemantically` controls semantic merging; defaults to `off`
# `overrideProperties` controls property overriding based on understandability; defaults to `on`
# `reduceNonAdjacentRules` controls non-adjacent rule reducing; defaults to `on`
# `removeDuplicateFontRules` controls duplicate `@font-face` removing; defaults to `on`
# `removeDuplicateMediaBlocks` controls duplicate `@media` removing; defaults to `on`
# `removeDuplicateRules` controls duplicate rules removing; defaults to `on`
# `removeEmpty` controls removing empty rules and nested blocks; defaults to `on` (since 4.1.0)
# `removeUnusedAtRules` controls unused at rule removing; defaults to `off` (since 4.1.0)
# `restructureRules` controls rule restructuring; defaults to `off`
# `skipProperties` controls which properties won\'t be optimized, defaults to empty list which means all will be optimized (since 4.1.0)

There is an all shortcut for toggling all options at the same time, e.g.

cleancss -O2 'all:off;removeDuplicateRules:on' one.css

As a module

clean-css-cli can also be used as a module in a way of enhancing its functionality in a programmatic way, e.g.

#!/usr/bin/env node

var cleanCssCli = require('clean-css-cli');

var customPlugin = {
  level1: {
    value: function (propertyName, propertyValue, options) {
      if (propertyName == 'background-image' && propertyValue.indexOf('../valid/path/to') == -1) {
        return propertyValue.replace('url(', 'url(../valid/path/to/');
      } else {
        return propertyValue;
      }
    }
  }
}

return cleanCssCli(process, function (cleanCss) {
  cleanCss.options.plugins.level1Value.push(customPlugin.level1.value);
});

FAQ

More answers can be found in clean-css FAQ section.

How to optimize multiple files?

It can be done by passing in paths to multiple files, e.g.

cleancss -o merged.min.css one.css two.css three.css

Since version 4.1.0 it can also be done using glob pattern matching, e.g.

cleancss -o merged.min.css *.css

How to process multiple files without concatenating them into one output file?

Since clean-css-cli 5.0 you can optimize files one by one, without joining them into one output file, e.g.

cleancss --batch styles/*.css

By default it will pick up every single file from styles directory, optimize it, add a -min suffix to filename (before extension), and write it to disk.

You can use --batch-suffix option to customize the -min suffix, e.g.

cleancss --batch --batch-suffix '.min' styles/*.css # output will have `.min` suffix before `.css`, e.g. styles.min.css

or

cleancss --batch --batch-suffix '' styles/*.css # output files will OVERRIDE input files

Remember you can use glob matching to match exactly the files you want.

Since clean-css-cli 5.1 you can also use a negated pattern to exclude some files from being matched, e.g.

cleancss --batch styles/*.css !styles/*.min.css

How to specify a custom rounding precision?

The level 1 roundingPrecision optimization option accept a string with per-unit rounding precision settings, e.g.

cleancss -O1 roundingPrecision:all=3,px=5

which sets all units rounding precision to 3 digits except px unit precision of 5 digits.

How to rebase relative image URLs?

clean-css-cli will rebase paths it automatically for you when full paths to input files are passed, and --with-rebase & --output options are used, e.g

/*! one.css */
a {
  background:url(image.png)
}
cleancss --with-rebase -o build/one.min.css one.css
/*! build/one.min.css */
a{background:url(../image.png)}

How to apply level 1 & 2 optimizations at the same time?

Using -O option twice and specifying optimization options in each, e.g.

cleancss -O1 all:on,normalizeUrls:off -O2 restructureRules:on one.css

will apply level 1 optimizations, except url normalization, and default level 2 optimizations with rule restructuring.

Contributing

See CONTRIBUTING.md.

How to get started?

First clone the sources:

git clone [email protected]:clean-css/clean-css-cli.git

then install dependencies:

cd clean-css-cli
npm install

then use any of the following commands to verify your copy:

npm run check # to lint JS sources with [JSHint](https://github.com/jshint/jshint/)
npm test # to run all tests

License

clean-css-cli is released under the MIT License.

clean-css-cli's People

Contributors

christiankozalla avatar davidjb avatar dependabot[bot] avatar dugwood avatar igauravsehrawat avatar jakubpawlowicz avatar mihai-vlc avatar superstormer avatar wenz avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

clean-css-cli's Issues

Bad interaction between mergeIntoShorthands and removeDuplicateRules

I've got cleancss 4.2.1 running on Node 10.13.0 on MacOS

Here's my input:

body {
    border-width: 1px;
    border-style: solid;
    border-color: red;
    border-color: #123456;
}

If I run cleancss -O2 on that file I get this output: body{border:1px solid red}

Even though the second border-color specification should override the first, it is the first that gets merged into the shorthand border property, and the output is not equivalent to the input.

incorrect removal of % unit in linear-gradient()

given: cleancss -d -O2 --format 'breaks:afterComment=on' -o style.min.css style.css

source:

background: linear-gradient(hsla(0, 0%, 98%, .8),hsla(0, 0%, 98%, .8)) 0 0 / 100% 1px no-repeat hsl(48, 75%, 77%);

result:

background: linear-gradient(hsla(0,0,98%,.8),hsla(0,0,98%,.8)) 0 0/100% 1px no-repeat #f0de98;

expected:

background: linear-gradient(hsla(0,0%,98%,.8),hsla(0,0%,98%,.8)) 0 0/100% 1px no-repeat #f0de98;

The hsla color notation requires the % unit for the second 0.

cleancss 5.1 (and 5.0.1 before)
npm 7.5.4
node 14.15.4
macOS 11.2.1

cleancss-cli 4.3 handled it correctly

feature request: configuration file

I would love to be able to include an external configuration file.
Minifiers like uglifyjs to html-minifier allow to use -c ./filename to include separate configurations (which could then be shared with other utilities in different development stages.
Users then could store their configs in e.g. a .cleancssrc file.

Breaking on remote @imports

Hello,

I am trying to use cleancss as follows
cleancss --inline all -o css/import.min.css css/import.css

But I get the following error

/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/writer/helpers.js:188
    switch (token[0]) {
                 ^
TypeError: Cannot read property '0' of undefined
    at all (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/writer/helpers.js:188:18)
    at serializeStyles (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/writer/simple.js:45:3)
    at /usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/clean.js:105:29
    at /usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:26:64
    at loadOriginalSources (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/load-original-sources.js:26:5)
    at /usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:26:14
    at applySourceMaps (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/apply-source-maps.js:34:5)
    at Object.callback (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:25:12)
    at doInlineImports (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:200:25)
    at inlineLocalStylesheet (/usr/local/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/reader/read-sources.js:327:10)

I have the following remote imports

@import url("http://fonts.googleapis.com/css?family=Muli");
@import url("http://fonts.googleapis.com/css?family=Montserrat");
@import url("https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css");

I have tried to increase the timeout but get the same error. When I do "--inline local" it works fine though the remote imports are not fetched as expected.

Thanks

TypeError: rules.split is not a function

$ uname -a
Linux ZdejPoham 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ nodejs -v
v9.5.0

$ cleancss -v
4.1.10

$ sudo npm install -g clean-css

$ cleancss -O2 --inline --compatibility 'ie7' -o frontpage.min.css frontpage.css
/usr/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/options/inline.js:12
rules.split(',');
^

TypeError: rules.split is not a function
at inlineOptionsFrom (/usr/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/options/inline.js:12:11)
at new CleanCSS (/usr/lib/node_modules/clean-css-cli/node_modules/clean-css/lib/clean.js:37:13)
at minify (/usr/lib/node_modules/clean-css-cli/index.js:215:18)
at cli (/usr/lib/node_modules/clean-css-cli/index.js:166:5)
at Object. (/usr/lib/node_modules/clean-css-cli/bin/cleancss:4:8)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)

npm update -g clean-css-cli does not update the clean-css dependency to the latest version

You fixed a bug in clean-css 4.0.4 and suggested to try that.

I already had clean-css-cli installed globally, I previously used this command to install clean-css-cli:
npm install -g clean-css-cli
and it properly installed (at that time) clean-css 4.0.2 as clean-css-cli's own dependency.

Now that you released clean-css 4.0.4, I tried to update clean-css-cli like this:

npm update -g clean-css-cli
but this command did nothing, clean-css-cli did NOT update its dependency from clean-css 4.0.2 to clean-css 4.0.4 as a normal user would expect.

The only way I found to update clean-css-cli to a version which uses the new clean-css 4.0.4 was this:
npm uninstall -g clean-css-cli
followed by:
npm install -g clean-css-cli

This is not too ideal... In other words: it's hard to update clean-css-cli, unless every time when you release a new version of clean-css you cut a release of clean-css-cli as well. And update clean-css-cli's package.json file, this part:

"dependencies": {
    "clean-css": "4.x",

to something like:

"dependencies": {
    "clean-css": "4.0.4",

If you did this then npm update -g clean-css-cli would have worked ...

Read CSS file from stdin

Would it be possible to run cleancss such that it reads the CSS file from the standard input instead of a named file? My CSS file is being generated dynamically it would be easier if I could avoid having to write out to a temporary file. I tried cleancss - but it doesn't seem to work:

ERROR: Ignoring local @import of "-" as resource is missing.

Can we clean multiples files using globs ?

If I have css files than I would like to clean like so:

css/
  style.css
  contact/
    contact.css

Can I use clean-css-cli like:

cleancss --level 1 --output css/**/*.min.css css/**/*.css

I do not want to list all my css in the command line or neither to edit the command line every time I add a new css file.

What I am aiming for is this result:

css/
  style.css
  style.min.css
  contact/
    contact.css
    contact.min.css

I could also accept having the source css file overwritten...

Thank you for your help.

Batch mode exclude files

@jakubpawlowicz I'm experimenting with the --batch option which seems exactly what we need on Bootstrap.

The problem I have is that I'm not sure how to exclude files. Currently we have all of our CSS files in one dir:

bootstrap-grid.css
bootstrap-grid.min.css
bootstrap-grid.rtl.css
bootstrap-grid.rtl.min.css
bootstrap-reboot.css
bootstrap-reboot.min.css
bootstrap-reboot.rtl.css
bootstrap-reboot.rtl.min.css
bootstrap-utilities.css
bootstrap-utilities.min.css
bootstrap-utilities.rtl.css
bootstrap-utilities.rtl.min.css
bootstrap.css
bootstrap.min.css
bootstrap.rtl.css
bootstrap.rtl.min.css

I tried excluding the files that end with *.min.css but it doesn't work:

cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix ".min" "dist/css/*.css" "!dist/css/*.min.css"
WARNING: Invalid character(s) '/*.min.css);' at 1:21. Ignoring.
internal/fs/utils.js:307
    throw err;
    ^

Error: ENOENT: no such file or directory, open '!dist/css/*.min.min.css'

Am I maybe missing something?

Thanks!

Compress all files in the directory

I have a case where i would just like to apply cleancss to every file in the directory, without name changing etc.

Ideally this would work:

cleancss path/to/css/*.min.css

I know i can dance around i with xargs and thats what I'm going to do ATM, but i suppose it can be a pretty common use case so i decided to create an issue to hear what you think about it.

Thanks for the great tool :)

RemoveQuotes not working

Hello, last week I upgraded cleancss version from 3.1.9 to 5.3.3

Now I'm getting different behaviour after using cleancss on the same source file. The quotes inside an "url" function aren't removed.

For example this source css:

@font-face {
    font-family: 'Catamaran';
    font-weight: 300;
    font-style: normal;
    src: local('Catamaran Light'),
    local('Catamaran-300'),
    url('/fonts/Catamaran-300/Catamaran-300.woff2') format('woff2'),
    url('/fonts/Catamaran-300/Catamaran-300.woff') format('woff');
    font-display: swap;
}

In cleancss 3.1.9 result:
@font-face{font-family:Catamaran;font-weight:300;font-style:normal;src:local('Catamaran Light'),local('Catamaran-300'),url(/fonts/Catamaran-300/Catamaran-300.woff2)format('woff2'),url(/fonts/Catamaran-300/Catamaran-300.woff)format('woff');font-display:swap}

In cleancss 5.3.3 (cleancss fonts.css -o fonts.cleaned.css or cleancss fonts.css -O1 -o fonts.cleaned.css):
@font-face{font-family:Catamaran;font-weight:300;font-style:normal;src:local('Catamaran Light'),local('Catamaran-300'),url('/fonts/Catamaran-300/Catamaran-300.woff2') format('woff2'),url('/fonts/Catamaran-300/Catamaran-300.woff') format('woff');font-display:swap}

I tried: cleancss fonts.css -O1 removeQuotes:on -o fonts.cleaned.css, also options like urlQuotes:false, but always I get quotes on the output. Using double quotes inside url() also keeps them in output.

Cannot read property '1' of undefined

I did an npm install clean-css-cli

In my webpack.config.js file imported the module
const CleanCSS = require('clean-css-cli');

Using webpack-merge-and-include-globally to merge multiple CSS files and my config looks like

const path = require('path');
const MergeIntoSingle = require('webpack-merge-and-include-globally');
const CleanCSS = require('clean-css-cli');

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist'),
  },
  plugins: [
    new MergeIntoSingle({
      files: [{
        src: ['src/style.css', 'src/style2.css'],
        dest: 'bundle.css',
     
        // also possible:
        //
        dest: code => ({
          'bundle.css':new CleanCSS({}).minify(code)
        }),
      }]
    })
  ]
};

On npx webpack I get an error that says
TypeError: Cannot read property '1' of undefined
at Command.parse (/Users/jaikirdatt/development/blog/webpack-test/node_modules/commander/index.js:462:43)
at new cli (/Users//development/blog/webpack-test/node_modules/clean-css-cli/index.js:120:12)
at Object.dest (/Users/jaikirdatt/development/blog/webpack-test/webpack.config.js:20:24)
at /Users/jaikirdatt/development/blog/webpack-test/node_modules/webpack-merge-and-include-globally/index.node6-compatible.js:97:50
at Generator.next ()
at step (/Users//development/blog/webpack-test/node_modules/webpack-merge-and-include-globally/index.node6-compatible.js:3:191)
at /Users//development/blog/webpack-test/node_modules/webpack-merge-and-include-globally/index.node6-compatible.js:3:361

Multiline comment ignoring with next selectors

For this css:

.cards--grid .cards__card {flex-basis:260px}
/* .cards--grid .card__imgw {margin:20px 20px 0 20px} */
.cards--grid .card__textw {position:relative; z-index:2; background:#fff; padding:15px 15px 0 15px }

i get this:

$ cat css | ./vendor/node_modules/clean-css-cli/bin/cleancss -O2 -o style.css
WARNING: Invalid selector '/* .cards--grid .card__imgw {margin:20px 20px 0 20px} */
.cards--grid .card__textw' at 813:0. Ignoring.

which of course breaks the code.
Сomment should be processed correctly.

Switch to async fs methods

Since Node.js is single-threaded, switching to async fs methods should make everything as fast as possible. The only exception AFAICT is fs.existsSync. While at it, it would definitely be worth switching to glob (async).

Not minifying when @import file has timestamp

When there is a query param on a css file (in this case a timestamp), clean-css-cli will not minify the current file. As soon as I remove the query param, it minifies the file. My goal is to ignore the @import statement but still minify the file.

I tried passing every conceivable option to prevent the clean css from processing this line:

@import url(font_awesome.css?t=1554926691456);

But it throws the error:

Ignoring local @import of "font_awesome.css?t=1554926691456" as resource is missing

cleancss, command not found if global isn't used while installing clean-css-cli

Hi,
Awesome tool.

cleancss isn't available on command line unless I install it globally. Pasting output for problem.

➜  Server git:(minify-assests) ✗ npm install --save clean-css-cli
~/Server
└── [email protected] 

➜  Server git:(minify-assests) ✗ cleancss
zsh: command not found: cleancss

In the documentation it's mentioned to install it locally using npm install clean-css-cli. Is it intended behavior?

I am using macOS, Sierra v10.12.4.

Thanks

incorrect handling of the `@container` at-rule

The (first) selector inside the at-rule together with the opening { of the rule-block and the first property-value pair is removed. (treated as an invalid property name).

input:

@container item (min-width: 400px) {
  .item_inner {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
}

output:

@container item (min-width: 400px){flex-direction:row;align-items:center}

.item_inner { display: flex; is removed, treated as an invalid peoperty name

Testedon macOS 12 with clean-css-cli 5.6.1 and reproduced on the clean-css website.

--skip-rebase should be the default

I want to provide a small, but important feedback, as it bit me really hard and I believe it'll bite many other users.

First and foremost, I am using clean-css and now the new clean-css-cli for CSS minification. This is the reference tool for this job, and congratulation for making this huge achievement!

However, the default URL rebasing is an extremely bug prone feature. Running the tool with one path in development (where rebasing might not trigger) might produce a totally different result compared to running in from a different path, or when bundling files for production in a script, because of the "smart" auto rebasing option.

I recommend switching that option off by default (as in making --skip-rebase the default) as it'll bite many other users who just prefer to use this tool as a CSS minifier, without any of the path relative smart rebasing magic (personally I'd categorise that feature as -O2 or even -O3).

Provide inputSourceMap

There does not seem to be a way to provide an input sourcemap when using the CLI.
Please add a --input-source-map option or allow --source-map to accepts a path to an existing map.

How do we preserve ALL comments?

I tried changing specialComments to 0, 1, and all and it had no effect. It kept the special comments.

How do we tell it to keep all comments?

Fails to write output to file if containing directory does not yet exist

If I try to output to a file in a target directory but that directory does not yet exist, the system throws an error. This does not happen if I use grunt-contrib-cssmin - it creates the missing directory structure for me, but I no longer want to use grunt. Here is the stack trace on a Windows 10 OS:

Error: ENOENT: no such file or directory, open 'C:\Users\Human\Documents\GitHub\crucial\public\dist\1.0.0\css\main.min.css' at Object.fs.openSync (fs.js:646:18) at Object.fs.writeFileSync (fs.js:1299:33) at output (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css-cli\index.js:323:8) at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css-cli\index.js:266:7 at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\clean.js:125:9 at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\read-sources.js:26:64 at loadOriginalSources (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\load-original-sources.js:26:5) at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\read-sources.js:26:14 at applySourceMaps (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\apply-source-maps.js:34:5) at Object.callback (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\read-sources.js:25:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] cleancss: cleancss -o public/dist/%npm_package_version%/css/main.min.css public/css/*.css npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] cleancss script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Batch suffix error under Windows 10

Reported by @jasonreiche in #65

When I run the command above currently under Windows 10 PS, using double or single quotes, I get this error:

error: option '--batch-suffix ' argument missing

Running it without --batch-suffix results in files being created in place under source/

Specify --output parameter as a folder, when using --batch

Hello!

Can I have --output parameter specified as a folder while --batch param is present?
I want to get minified css files one by one (as --batch param does) in some other folder. But in default manner, minified files are generated at same path as source files.
I'd like to run script with --batch param and have --output /some/folder (not file).
I know I can just copy minified files to any other folder with another script, but maybe my point of view is not so bad?

Thanks in advance for your information, advices and opinions!

feature request: source map rebase

It would be great to have an option similar to uglifyjs, which allows rebasing source map source URLs/paths. Right now source map has sources path relative to my working directory - where I am using CLI and there is no way to change it.

New v5.0.0 version is always rebasing urls

Urls are getting rebased always, even when --with-rebase option is not used.

Both of these rebase urls and produce the same results:

cleancss assets/css/styles.css -o dist/css/styles.min.css
cleancss assets/css/styles.css -o dist/css/styles.min.css --with-rebase

In the source css, I have font and img references like these:

url('../fonts/roboto-400-latin.woff2')
url('../img/bg.jpg')

And with v5.0.0, I get these urls in the minified file, both with and without --with-rebase:

url('../../assets/fonts/roboto-400-latin.woff2')
url('../../assets/img/bg.jpg')

With previous v4.3.0, I used --skip-rebase and was getting:

url('../fonts/roboto-400-latin.woff2')
url('../img/bg.jpg')

I'm running macOS Big Sur 11.2.

Export CLI as a module

So bin/cleancss looks something like:

#!/usr/bin/env node

var cleanCssCli = require('clean-css-cli');
return cleanCssCli(process);

One could reuse the CLI to do some custom magic:

#!/usr/bin/env node

var cleanCssCli = require('clean-css-cli');
return cleanCssCli(process, function beforeMinify(cleanCssObject) { /* do whatever magic you fancy */ });

Unable to get same output as refresh-sf

Hey,

I'm struggling to get clean-css to give me merged rules and overwritten properties.

I have a test case here https://github.com/matt3224/remove-dupe-props-test

I am expecting the following output:

.button {
  align-items: flex-end;
  background-color: red;
  border: 1px solid red;
  border-radius: 6px;
  bottom: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, .25);
  box-sizing: content-box;
  color: snow;
  cursor: grab;
  display: inline-flex;
  flex: 1 0 100%;
  flex-direction: row;
  font-family: Helvetica, Arial, sans-serif;
  height: 40vh;
  left: 1rem;
  line-height: 1.5;
  margin: 1rem 2rem;
  max-width: 40rem;
  min-height: 20rem;
  opacity: .8;
  overflow: visible;
  padding: 1.5rem;
  position: fixed;
  right: 1rem;
  text-align: start;
  transition: all .5s ease;
  top: 1rem;
  width: 90vw;
  z-index: 2
}

Any help much appreciated

Clean CSS stopped working with Sublime Formatter

There is some console output and it stopped working completely with Formatter in Sublime 3 on OS X.
Sublime Linter states e.g.:
index.css: No lint results.

SublimeLinter: WARNING: csslint: Implicit appending a filename to cmd has been deprecated, add '${temp_file}' explicitly.

Update clean-css version to latest

Hi, I just noticed that clean-css is set to version 4.1.9 in the dependencies. Is there any way we could get a new CLI release with that dep version bumped up?

Cannot install in docker container

I have a simple Dockerfile:
FROM node:latest
RUN npm install -g handlebars uglify-es less clean-css-cli

When i build the image everything seems to run fine:

Step 2/2 : RUN npm install -g handlebars uglify-es less clean-css-cli
---> Running in 21f8aba5497b
/usr/local/bin/cleancss -> /usr/local/lib/node_modules/clean-css-cli/bin/cleancss
/usr/local/bin/handlebars -> /usr/local/lib/node_modules/handlebars/bin/handlebars
/usr/local/bin/lessc -> /usr/local/lib/node_modules/less/bin/lessc
/usr/local/bin/uglifyjs -> /usr/local/lib/node_modules/uglify-es/bin/uglifyjs

However when i run the container cleancss is missing from both /usr/local/bin and /usr/local/lib/node_modules
All other modules install fine
Am i missing something about installing clean-css-cli?

Node version: 10.7.0
Npm version: 6.1.0
Docker version: 17.09.0-ce, build afdb6d4

processing absolute path import

hey,

i have a bunch of css such as

//file: backend/public/app.css
@import url("normalize.css");
@import url("/assets/ui/mustard.css");
@import url("/assets/ui/icons.css");
@import url("/assets/ui/alert-box.css");
@import url("/assets/ui/toggle.css");
@import url("/assets/ui/modal.css");
@import url("/assets/ui/color.css");
@import url("/assets/ui/base.css");
@import url("/assets/ui/btn.css");
@import url("fa/css/solid.min.css");
@import url("fa/css/fontawesome.min.css");
@import url("blue.css");
//...

Css files using an absolute path (/assets...) are handled within the router using a virutal urls, their real path is located at, starting from the makefile working dir, backend/public/../../../ui/public

I try to build my file using

cleancss -O1  -o build/backend/public/app.css backend/public/app.css

I end up with,

cleancss -O1 --skip-rebase  -o build/backend/public/app.css backend/public/app.css
ERROR: Ignoring local @import of "/assets/ui/mustard.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/icons.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/alert-box.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/toggle.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/modal.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/color.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/base.css" as resource is missing.
ERROR: Ignoring local @import of "/assets/ui/btn.css" as resource is missing.

Is there some switches i can enable right now to pass that issue ? Maybe the cli can benefit a flag to perform pattern matching rebasing, something like --rebase="/assets to ../../../ui/public"

cheers

clean-css-cli does not work on Windows properly

If you are on the Windows platform and the CSS file you are trying to minify is on a different drive letter, e.g.: drive F: instead of the default drive C: and you attempt to run the cleancss command with an absolute path pointing to the input file (as well as an absolute path to the output file) then clean-css-cli is trying to import something from an invalid path, see:
7d2991665c666f8d4940ed49060ac1e6

A directory or file name on Windows cannot contain the colon ( : ) character!

This issue is originally surfaced here: tssajo/Minify#51

This is a regression introduced in clean-css-cli.

clean-css 3.x.x in the same situation worked just fine.

Rebases relative images URLs unexpectedly

Docs state relative urls are handled automatically “when full paths to input files are passed in and --output option is used”. However, when the -o|--output flag is omitted relative image paths are still updated.

Is this an error in the CLI or a typo in the documentation?

Given users not using -o are likely hand-rolling an asset pipeline this url rebase magic is probably best left to their discretion. In my case I've already used sed to update my image URLs before running cleancss and my URLs are modified again unexpectedly.

Breaks shell command because of ; character

How is the official example of

cleancss -O1 all:off;tidySelectors:on one.css

supposed to work? To all of my knowledge this is interpreted as two separate commands by bash. Of course neither cleancss -O1 all:off nor tidySelectors:on one.css is a valid command, so it returns a help for the first one and -bash: tidySelectors:on: command not found for the second one.

Incorrect URL rebasing

  • Using command cleancss --with-rebase src/scss/index.css -o dist/main.min.css.
  • A URL within /src/scss/modules/_component.scss is being re-based incorrectly.
  • CSS: url("../../assets/icons/icon-chevron.svg");
  • Rebases to: url("../assets/icons/icon-chevron.svg");
  • Should rebase to: url("assets/icons/icon-chevron.svg");

Not work cleancss -O0 less.css

this is a bug

  options = {
    batch: inputOptions.batch,
    compatibility: inputOptions.compatibility,
    format: inputOptions.format,
    inline: typeof inputOptions.inline == 'string' ? inputOptions.inline : 'local',
    inlineTimeout: inputOptions.inlineTimeout * 1000,
    level: { 1: true },
    output: inputOptions.output,
    rebase: inputOptions.withRebase ? true : false,
    rebaseTo: undefined,
    sourceMap: inputOptions.sourceMap,
    sourceMapInlineSources: inputOptions.sourceMapInlineSources
  };

  if (program.rawArgs.indexOf('-O0') > -1) {
    options.level[0] = true;
  }

  if (program.rawArgs.indexOf('-O1') > -1) {
    options.level[1] = findArgumentTo('-O1', program.rawArgs, program.args);
  }

if use level -O0
level: { 1: true },
options.level[1] is always true

  if (program.rawArgs.indexOf('-O1') > -1) {
    options.level[1] = findArgumentTo('-O1', program.rawArgs, program.args);
  }else{
    options.level[1] = false;
  }

Option to remove imported files

Opened by @mikkotikkanen in clean-css repo - moving it here as it'll be a CLI feature.

Note that API already exposes a list of imported files under inlinedStylesheets field in output hash.


If you are running master css file which is just split with imports, it would be nice to have r.js styled removing of the imported files

Ie. if

master.css

@import('buttons.css')
body { background: #fff; }

buttons.css

.btn { background: #bada55; }

Would then become...

master.css

.btn { background: #bada55; }
body { background: #fff; }

...with buttons.css removed.

If file is not imported anywhere, it would be just minified as usual.

Is it possible to output to the same file?

Hey,

I've read the doc but I can't find the answer.

Basically, I have a folder of CSS files (including subdirectories) and I'm trying to minify all files but keep the structure the same. Is that possible?

Cheers,
Adam

Allow * when specifying multiple input files

When listing input files as

cleancss public/css/* public/app.css

it gives the error:

WARNING: Invalid character(s) '/*;@import public/app.css;' at 1:18. Ignoring.

Different variations of forward and backward slash, as well as removing the * (hoping it would peek into the folder), resulted in failure as well.

It would be handy if I didn't have to list each file separately, by allowing a wildcard *. I would like to merge the css files from imported libraries with my own css to reduce the number of http calls the browser has to make. Unfortunately, the calls to this tool become quite lengthy due to the number of libraries.

Version: 4.0.0
OS: Windows

5.0.1 warnings

Hey, @jakubpawlowicz. I haven't had a chance to test #51 yet, but decided to give 5.0.1 a go with our current main branch. I keep getting this on Windows:

C:\Users\xmr\Desktop\bootstrap>npm run css-minify

> [email protected] css-minify C:\Users\xmr\Desktop\bootstrap
> npm-run-all --parallel css-minify-*


> [email protected] css-minify-rtl C:\Users\xmr\Desktop\bootstrap
> cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap.rtl.min.css dist/css/bootstrap.rtl.css && cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-grid.rtl.min.css dist/css/bootstrap-grid.rtl.css && cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-utilities.rtl.min.css dist/css/bootstrap-utilities.rtl.css && cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-reboot.rtl.min.css dist/css/bootstrap-reboot.rtl.css


> [email protected] css-minify-main C:\Users\xmr\Desktop\bootstrap
> cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-utilities.min.css dist/css/bootstrap-utilities.css && cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css

WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap.rtl.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap-grid.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap-grid.rtl.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap-utilities.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap-utilities.rtl.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap-reboot.css.map" as resource is missing.
WARNING: Ignoring local source map at "C:\Users\xmr\Desktop\bootstrap\bootstrap-reboot.rtl.css.map" as resource is missing.

It seems something is wrong with paths on Windows because the referenced map filepaths are wrong. dist/css is missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.