
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Webfiller puts data and styling into Web pages on the server and in the browser, by Harald Rudell
Webfiller puts data into html5 web pages.
And...
Webfiller thinks of your html in terms of views:
Webfiller injects data into web pages. Since there is no template language, the locations where to put data is declared as bindings.
Binding key is a string defining where in the markup to inject data:
'.class' are all elements that have this class
'#id' is the element with this id attribute
'tag' all elements with this tag, eg. 'title'
'' the document location preceding the first tag
A location is an opening tag
A tag is not a comment, directive or unescaped text segment
An opening tag may be a void tag, ie. <br/>
Binding value declares what to insert at the location
string 'datafield' a key in the data values provided in the options object
Array facilitates the same value or custom function to be applied multiple times
object: A number of custom functions applied
Custom Functions Typically values are inserted befire existing tag content.
fragment: 'fragmentname' insert the output from rendering a fragment, ie. a small piece of html
append: binding value Appends rather then inserts content
replace: binding value: replaces current element content
addClass: 'class1 class2': adds the listed classes to the tag
removeClass 'class1 class2': removes the listed classes from the tag
attribute: { id: false, display:'none'}: removes the id attribute, and inserts the attribute display=none
Custom functions coded in JavaScript can be added that be used both on the server and in the browser.
A view is compiled on server startup. Compiling takes the view and a bindings object to produce a view executable. The view executable can render both on the server and in the browser.
Views are rendered as usual. A bindings field provided at rendering may include additional fragments and custom functions.
In the browser: WF.render(data, fragment, domain) produces a string of rendered html
data: a JavaScript object containing data fields
fragment a fragment name such as 'list' or 'list.index'
domain: optional domain for the fragment
Fragments are associated with the view where they were declared. A view declaring fragments is known as a domain. When a fragment without a domain is included, the parent fragments's domain is first searched for the fragment name, then the first domain containing that fragment name is used. To render from an exact domain use 'list.index' to only search the index domain.
Webfiller facilitates dual-side JavaScript that is executed both on the server and in the browser. Webfiller provides a small set of basic functions, and custom functions can add or override those functions. The benefit is that the same custom code is neatly organized and available both in the browser and on the server at no extra effort.
Webfiller uses two folders: the view folder and the webfiller folder. The webfiller folder has files written to it that should be aviailable as Web resources for the browser. Typically this is one JavaScript and one css file copied from support files for each main view.
All code, markup and styling pertaining to a main view is enclosed in the main view and its sibling folder. This has a benefit that it makes it really easy to copy a view to another project.
if there is a JavaScript file in the sibling folder, by the same name as the main view, then three exports is used from this file:
getHandler export: a handler function that Express uses to render the view
fragments: A Javascript object with fragment names and their bindings.
publicFragments: fragments that will be made available to the browser
Javascript provided to the browser:
In Express' root views folder:
index.html - a main view for the site's root url '/'
index - a sibling folder
otherview.html - the view '/otherview'
otherview - a sibling folder containing fragment, code and styling for otherview
TODO examples
(c) Harald Rudell wrote this for node in August, 2012
No warranty expressed or implied. Use at your own risk.
Please suggest better ways, new features, and possible difficulties on github
FAQs
Webfiller puts data and styling into Web pages on the server and in the browser, by Harald Rudell
We found that webfiller 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.