Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
goldfish-compiler
Advanced tools
A CLI based compiler to convert es6 javascript to ASP Classic pages with dynamic polyfilling and hot-reloading.
A CLI based compiler to convert ES6 Javascript to ASP Classic pages with dynamic polyfilling and dependency management.
As of 2.2.x Goldfish now supports nested folders/file structures, so if you were using it flatly before 2.2.x bear that in mind.
.goldfish.json
- 2.3.0You must have Nodejs installed
npm install -g goldfish-compiler
Now, in any directory enter goldfish
to build!
Protip: Arguments like
--in
,--out
and--ext
are universal.
goldfish
- classic once-offgoldfish dev
- hot-compiling on-save for developmentCommand | Parameters | Default |
---|---|---|
goldfish | All (see below) | See below. |
goldfish dev | --min , --in , --out , --ext , --nolog , --nodeps , --host | See below. |
All parameters are prefixed with double dash (i.e
goldfish --min
)
Argument | Description | Example | Default |
---|---|---|---|
min | Minify the compiled files. Slower than the default pretty-printed files. | na. | disabled |
out | The output location for the compiled files. | goldfish --out api will output the files to a folder called "api". | --out dist |
in | The file location of the files to compile. | goldfish --in src will build the files inside the folder "src". | Current directory. |
ext | The file extension of the files to compile. ("." emitted.) | goldfish --ext js will output the files in a folder called "api". | --ext es6 |
nodeps | Don't include the default included depedencies (i.e JSON2) | na. | disabled |
nolog | Don't replace Javascript's console.log with Response.Write | na. | enabled |
host | ip and port for polyfill service API. | 192.168.0.1:5858 | https://polyfill.io/ |
v | Log the current version. | na. | na. |
All these arguments can be used in a .goldfish.json
file in your working directory. So:
{
"ext": "js",
"host": "192.168.100.1:3000",
"in": "./apis"
}
Order of importance is: command arguments > .goldfish.json
> defaults
Here's an example of an ASM:
const user = "Shaggy"
Session("user") = user;
console.log(Session("user"))
Since that's invalid javascript, the compilers break and explode and nobody's happy.
To fix this, add //*
before JS breaking ASMs. The correct way to do this is:
const user = "Shaggy"
//* Session("user") = user;
console.log(Session("user"))
And viola!
Let's say we have a ES6 file like this:
// example.es6
console.log('nice!');
...after goldfish
is done, that becomes example.asp
inside dist/
:
<!--#include file="_pf.asp"-->
<!--#include file="_mpf.asp"-->
<script language="javascript" runat="server">
//Built 26-Mar-18, 12:13:02 PM, undefined
Response.Write('nice!');
</script>
_pf.asp
file, which has all of the ES3 polyfills (in this case Array.prototype.map
)dependency
file json.asp
(which has JSON2 inside, as ASP Classic doesn't natively support JSON)console.log
with Response.Write
). This file is wrapped with the appropriate Includes (see below) and wrapped in a try/catch
function and wrapped with <script language="javascript" runat="server">...</script>
.Typically in ASP Classic you include other ASP files like this:
<!--#include file="./mypage.asp"-->
But, of course, when writing Javascript this doesn't work... so:
// page1.asp
include('./mypage.asp'); // woah, js magic
...
const shaggy = "cool stuff, scoobs!"
...
...will become
<!--#include file="./mypage.asp"-->
...
var shaggy = "cool stuff, scoobs!";
...
Copyright (c) 2017, pxljoy.io (MIT License)
See LICENSE for more info.
Coded with ♥️ by pxljoy.io
FAQs
A CLI based compiler to convert es6 javascript to ASP Classic pages with dynamic polyfilling and hot-reloading.
The npm package goldfish-compiler receives a total of 30 weekly downloads. As such, goldfish-compiler popularity was classified as not popular.
We found that goldfish-compiler 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.