
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
ng-tailwindcss
Advanced tools
A helpful cli tool for integrating tailwindcss with angular-cli projects
After starting your new angular-cli project run these commands:
npm i ng-tailwindcss -g
npm i tailwindcss -D
./node_modules/.bin/tailwind init
ng-tailwindcss configure
touch src/tailwind.css
Put all your tailwind imports in src/tailwind.css
and run:
ng-tailwindcss scripts
Run npm start
and let the wind fill your wings!
Install globally:
npm i ng-tailwindcss -g
If you don't already have an angular project up and running, start your angular project (assumes angular cli is already installed globally):
ng new angular-meets-tailwind
Follow Steps 1-3 from the Tailwind Installation Instructions: Install Tailwind (npm i tailwindcss -D
), initialize (./node_modules/.bin/tailwind init
), and use tailwind in your source css files.
A recommendation for new projects (no prior stylesheet changes) is to touch src/tailwind.css
and use that file for all global styles and component classes.
Configure your tailwind source/destination/config files by running:
ng-tailwindcss configure --config ./path/to/whatever-you-named-tailwind-config.js --source ./path/to/your-tailwind-source.css --output ./path/to/whatever-you-call-it.css
This will result in an ng-tailwind.js
file at your project's root:
module.exports = {
configJS: './path/to/whatever-you-named-tailwind-config.js',
sourceCSS: './path/to/your-tailwind-source.css',
outputCSS: './path/to/whatever-you-call-it.css'
}
See Configuration Below for More Details and Implications for Existing Angular Projects
Add or adjust these scripts in your package.json:
scripts: {
"prestart": "ng-tailwindcss build",
"start": "ng serve & ng-tailwindcss watch",
"build": "ng-tailwindcss build && ng build"
}
or simply run ng-tailwindcss scripts
to have these adjustments made automatically in your package.json
.
Now using npm start
for your development server will ensure your tailwind files are being watched and built with your project, and you can still rely on the angular-cli for everything else (no ng eject
! yay!).
Keep calm and angular on.
The ng-tailwind.js
file can be directly manipulated (in keeping with the tailwind way of doing things) after the initial configuration command has been run. Conversely, if you prefer the command line, running ng-tailwindcss configure
a second time will overwrite only the properties specified by the flags you include (e.g. ng-tailwindcss configure -c ./new-tailwind-config.js
will only change the configJS
property, and retain the original values for sourceCSS
and outputCSS
).
Important: The default config (running ng-tailwindcss configure
with no arguments) will assume a configuration of:
{
configJS: './tailwind.js',
sourceCSS: ''./src/tailwind.css',
outputCSS: './src/styles.css'
}
It should be noted that such a configuration will set up your project to overwrite angular's default styles.css
during each build, so if you desire to use the defaults in your existing project (recommended), you should remove any css from this file and place it in sourceCSS
(the default being src/tailwind.css
). If you are using styles.css
as a source file (not really recommended), don't forget to edit your angular.json styles
array to reflect your new global stylesheet (probably your outputCSS
, but more complicated scenarios are certainly possible--be safe out there!).
You can alias your commands or argument flags thus:
configure => c
--config => -c
--source => -s
--output => -o
watch => w
build => b
scripts => s
--help => -h
--help
provides descriptions of each command or argument.
Yes, please.
FAQs
A helpful cli tool for integrating tailwindcss with angular-cli projects
The npm package ng-tailwindcss receives a total of 136 weekly downloads. As such, ng-tailwindcss popularity was classified as not popular.
We found that ng-tailwindcss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.