Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Bootstrap/Scaffold a project for use with Piggy in the Middle and Baconize
Bootstrap/Scaffold a project for use with Piggy in the Middle and Baconize.
To install:
npm install barnyard
To scaffold out a project using html
, scss
, babel
, you could do:
var barnyard = require('barnyard');
var scaffoldDir = '/path/to/dir';
var options = {
styles: { type: 'scss' },
scripts: { type: 'babel' },
whitespaceFormatting: 2,
babelPolyfill: true,
normalizeCss: true,
};
barnyard(scaffoldDir, options).then([successFn],[errorFn]);
// [successFn] will be passed an array of the files that were created during the scaffold
This will scaffold a project that has the following directory structure:
/path/to/dir
├─┬ scripts
│ ├── main.babel.js
│ └── polyfill.js
├─┬ styles
│ ├── main.scss
│ └── normalize.css
└ index.html
And here is a truncated version of the html file:
<!DOCTYPE html>
<head>
<!-- ... -->
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/main.css">
</head>
<body>
<!-- ... -->
<script src="scripts/polyfill.js"></script>
<script src="scripts/main.js"></script>
</body>
</html>
html
type (String, default = 'html'): Which languages to use for html documents. Possibilities: 'html', 'jade'.
file (String, default = 'index'): Filename (without extension) for main html document.
styles
type (String, default = 'css'): Which languages to use for stylesheets. Possibilities: 'css', 'scss', 'sass', 'less', 'styl'.
file (String, default = 'main'): Filename (without extension) for main style file.
folder (String, default = 'styles'): folder where style files are stored.
scripts
type (String, default = 'js'): Which languages to use for javascript. Possibilities: 'js', 'babel', 'coffee'.
file (String, default = 'main'): Filename (without extension) for main script files.
folder (String, default = 'styles'): folder where script files are stored.
babelPolyfill (Boolean): Include and reference the babel polyfill.
normalizeCss (Boolean): Include and reference normalize.css.
whitespaceFormatting (Number/String, default = 'tabs'): Formatting for whitespace. If not specified then tabs will be used, otherwise you can pass a number (e.g. 2, 4, 8) and the corresponding number of spaces will be used
Here is a full list of the defaults:
{
html: {
file: 'index',
type: 'html', // or 'jade'
},
styles: {
folder: 'styles',
file: 'main',
type: 'css', // or 'scss', 'sass', 'less', 'styl'
},
scripts: {
folder: 'scripts',
file: 'main',
type: 'js', // or 'babel', 'coffee'
},
babelPolyfill: false,
normalizeCss: false,
whitespaceFormatting: 'tabs',
}
FAQs
Bootstrap/Scaffold a project for use with Piggy in the Middle and Baconize
The npm package barnyard receives a total of 4 weekly downloads. As such, barnyard popularity was classified as not popular.
We found that barnyard 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
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.