New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

binline

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binline

A pocket build tool for simple file inlining

latest
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

Binline

A pocket build tool for web-development (or more). (motto: The build system for the lazy developer)

Usage

This might be ./index.html:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Testing</title>
	</head>
	<body>
		<h1>A Test Page</h1>
		<script>
			{{ @inline "./app.js"}}
		</script>
	</body>
</html>

and this ./app.js:

// Some random code

console.log('Hello World!');

To let the thing work you need to setup the files to compile in your package.json:

{
	...
	"binline": {
		"files": [
			{ "from": "./index.html", "to": "./public/index.html" }
		]
	}
	...
}

Just call binline from the shell to build everything

Going advanced

For now you can only use @inline, but the expressions can become more complex. Advanced command to uglify the code:

	...
	{{
		@inline "./app.js"
		| content => require('uglify-js').minify(content, { fromString: true }).code
	}}
	...

You may pass more commands separated by a |. After the first directive (@inline) the binline expects a series of arrow function transform text.

Future

1

Add a way to predefine transformers:

...
{{ @define uglify | content => require('uglify-js').minify(content, { fromString: true }).code }}
...

and use them:

...
{{ @inline "./app.js" | uglify }}
...

2

When predefined trasformers will be a thing I might add a small registry with a list of common transformers (uglify, babel, sass, less, coffeescript, ...)

Keywords

build

FAQs

Package last updated on 27 Dec 2016

Did you know?

Socket

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.

Install

Related posts