Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
slice-machine
Advanced tools
Tired of manually copying HTML & CSS and transforming it into your favorite framework views and styled ? Meet slice-machine
a tool that allows you to slice up your existing HTML templates and styles and nice component based UI for your favorite framework
npm install -g slice-machine
Create a config file, slice-machine.config.js
in the directory where you plan in running the commands.
This file will be read by Slice Machine and the instructions in it executed.
Default name of the config file is slice-machine.config.js
and this is what will be used by slice machine to fetch the needed resources.
This is a NodeJS module so you can import other modules and do whatever you want as long as you export a JS object.
module.exports = {
slices: [
{
url: 'https://examplesite.com/',
sel: '.post',
name: 'PostComponent',
sheetName: 'PostComponentStyle.ts',
codeFileName: 'PostComponent.ts'
}
],
output: {
path: 'dist'
}
};
Each slice is defined by:
The URL to open in order to get the slice
A CSS selector, similar to what you would give to document.querySelector
in order to get to the slice
A meaningfull, component name given to the slice
How the file containing the CSS styles should be named
How the file containing the Javascript code for the slice should be named
The styles & javascript code for all the files will be written to the directory specified
in output -> path
section of the config.
It defaults to .
.
FAQs
Fetch HTML/CSS and transform it into components
The npm package slice-machine receives a total of 0 weekly downloads. As such, slice-machine popularity was classified as not popular.
We found that slice-machine 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.