Jose Constela

Jose Constela


👋 I’m a software development consultant, I have been programming since 12 years old and more than 8 professionally.

January 2019
M T W T F S S
« Dec   Mar »
 123456
78910111213
14151617181920
21222324252627
28293031  

Categories


Introducing nodesfc (Single File Code)

joseconstelajoseconstela

Single File Code, or sfc, allows to execute nodejs scripts with its dependencies defined in the script itself.

Instead of having a package.json file and installing the dependencies via npm commands, you can specify the dependencies in your script comments.

SFC will take care of installing the dependencies.

Package

https://www.npmjs.com/package/nodesfc

Usage

Define your script dependencies as comment

/**
 * @dependency lodash latest
 */
require('lodash').map([1,2,3,4], n => console.log(n))

Execute nodesfc

nodesfc myfile.js
Comments 0
There are currently no comments.