Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
patternslib
Advanced tools
Patternslib is a JavaScript library that enables designers to build rich interactive prototypes without the need for writing any Javascript. All events are triggered by classes and other attributes in the HTML, without abusing the HTML as a programming la
Patterns is a toolkit that enables designers to build rich interactive prototypes without the need for writing any JavaScript. All events are triggered by classes and other attributes in the HTML, without abusing the HTML as a programming language. Accessibility, SEO and well structured HTML are core values of Patterns.
Patterns aims to support at least the two latest major versions of all popular browsers.
Currently that means:
Other browser version may work too, but are not actively tested against.
Make sure, you have these requirements installed:
- Node.js ( https://nodejs.org/en/ )
- yarn ( https://yarnpkg.com/ )
The following commands will generate a bundle.js
file in the dist
directory
which contains Patterns and all its dependencies:
git clone git://github.com/Patternslib/Patterns.git
cd Patterns
make
Alternatively, you can download a bundle at patternslib.com.
The bundle itself is included via a <script>
tag.
But the bundle loads also other assets dynamically - most importantly other JavaScript files from a webpack-built directory called chunks
.
By default the path where these files are loaded is the absolute path /dist/
.
You might want to override this path for your application.
There are two ways to do this:
src/patterns.js
you can import on top of all other imports another file like src/public_path.js
and define the public path for webpack like so:__webpack_public_path__ = "/my-other-dist-directory";
<script>
tag in your header BEFORE you load the bundle like so:<script>window.__patternslib_public_path__ = "/my-other-dist-directory/";</script>
For Internet Explorer support we have included a src/polyfills.js
module.
You can inlcude it optionally via src/polyfills-loader.js
which injects the polyfills bundle only if the current browser is Internet Explorer.
For this to work, include the following in BEFORE you load the patternslib bundle:
<script src="/your-dist-directory/polyfills-loader.js" type="text/javascript"></script>
Note: this only works, if the bundle nor the polyfills-loader are not loaded asynchronously. The script loading order matters here and async loading has no deterministic loading order.
The individual patterns are located in their own folders in ./src/pat/
.
Each pattern folder contains some or all of the following files:
To generate CSS files from the pattern's included Sass files, type make all_css
and the css files will be generated in the same location as the Sass files.
You'll need to have a Sass compiler installed.
To demo the patterns, simply type make serve
to install the necessary
dependencies and to start a simple Node.js HTTP server.
You can then visit http://localhost:4001 to see a site with demos.
Alternatively, patterns can also be demoed through the Patternslib.com website, which is open-source. The code and setup instructions are here.
To develop on Patterns, clone the repository and set it's push-url to your fork:
git remote set-url --push origin <url_to_your_fork>
Create a branch for the feature/bug you are working on:
git checkout -b <feature>
For inclusion use either a GitHub pull request or create a ticket with a url to your external repository.
The simplest way to run the tests are to use make:
make check
This will install all required npm and bower packages and run the tests.
Eventually add to tests:
import "core-js/stable";
import "regenerator-runtime/runtime";
Then:
node --inspect-brk node_modules/.bin/jest --runInBand ./src/pat/tooltip/tooltip.test.js
Connect in chrome via:
chrome://inspect
You can pass Jest any parameter it accepts, like -t TESTPATTERN
::
node --inspect-brk node_modules/.bin/jest --runInBand ./src/pat/tooltip/tooltip.test.js -t will.be.closed.when
https://survivejs.com/webpack/optimizing/build-analysis/ https://formidable.com/blog/2018/finding-webpack-duplicates-with-inspectpack-plugin/
Build the stats.json file:
yarn build:stats
Check dependency tree and why which package was included: https://www.npmjs.com/package/whybundled
whybundled stats.json
Visualize dependency tree and analyze bundle size: https://www.npmjs.com/package/webpack-bundle-analyzer
webpack-bundle-analyzer stats.json
FAQs
Patternslib is a JavaScript library that enables designers to build rich interactive prototypes without the need for writing any Javascript. All events are triggered by classes and other attributes in the HTML, without abusing the HTML as a programming la
The npm package patternslib receives a total of 0 weekly downloads. As such, patternslib popularity was classified as not popular.
We found that patternslib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.