Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4455787
kat.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
454 B
Referenced Files
None
Subscribers
None
kat.js
View Options
#!/usr/bin/env ant
import
fs
from
'node:fs'
;
import
path
from
'node:path'
;
function
exit
(
message
)
{
console
.
log
(
message
);
process
.
exit
(
1
);
}
const
file
=
process
.
argv
[
2
];
if
(
!
file
)
exit
(
'usage: kat <file>'
);
try
{
const
content
=
fs
.
readFileSync
(
file
,
'utf8'
);
if
(
/\.(c|m)?(j|t)s$/
.
test
(
path
.
extname
(
file
)))
{
console
.
log
(
Ant
.
highlight
(
content
));
}
else
console
.
log
(
content
);
}
catch
(
err
)
{
exit
(
`file '
${
err
.
path
}
' not found`
);
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, May 2, 2:47 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
541815
Default Alt Text
kat.js (454 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment