
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
chatgpt-template
Advanced tools
Talk to ChatGPT in JS TemplateString Style with Streaming Support
import { gpt } from "chatgpt-template";
console.log(await gpt`Hello, world`); // greetings
import { gpt } from "chatgpt-template";
const obj = await gpt`
You are an AI assistant that speak only plain JSON without codeblock fence.
Now give me a json example about my dog.
`.json();
console.log(JSON.stringify(obj, null, 2));
/*
{
"dog": {
"name": "Buddy",
"breed": "Golden Retriever",
"age": 3,
"color": "Golden",
"weight": 70,
"vaccinated": true,
"favoriteToys": [
"rubber ball",
"tug rope",
"squeaky toy"
],
"owner": {
"name": "John",
"contact": {
"phone": "123-456-7890",
"email": "john.doe@example.com"
}
}
}
}
*/
import vm from "vm";
import { gpt } from "chatgpt-template";
const code = await gpt`
You are an AI assistant that speak only JavaScript (and JSDOC) without codeblock fence.
Now defined a function to validate password strength, level is from 1 to 5.
function passwordValidate(password): {level, notice};
Inputs: password
Output: { level, notice }
`.text();
console.log(code);
const context = vm.createContext();
const { level, notice } = new vm.Script(
code + '; passwordValidate("Rue1DHuoP2DeCP16")',
).runInContext(context);
console.log({ level, notice });
import { gpt } from "chatgpt-template";
import DIE from "@snomiao/die";
export const GET = async (req: NextRequest) =>
await gpt`
You are an AI flash card making assistant, please make flash cards for new words in given articles or note-lists, give me a csv with head Front,Back, which Front is Japanese word, and Back is "振仮名 of the Japanese world...<br />(English Translation...)"
Here is my input:
${req.nextUrl.searchParams.get("q") ?? DIE("Missing Query")}
`; // new Response( ... token ... stream ... )
import { gpt } from "chatgpt-template";
await gpt`
You are an AI flash card making assistant, please make flash cards for new words in given articles or note-lists, give me a csv with head Front,Back, which Front is Japanese word, and Back is "振仮名 of the Japanese world...<br />(English Translation...)"
Here is my input:
ロート製薬は、子どもの花粉症に関するアンケート調査の結果を公表した。花粉症で目がかゆい小学生の4人に1人が「授業など勉強に集中できない」と訴える一方、子どもが日常生活で感じる影響を親は十分に把握できていない状況も明らかになった。
【あなたの地域は?】スギ、ヒノキ…花粉が本格飛来する時期
調査は1月24~25日、0歳から16歳の子どもを持つ親7131人を対象にインターネットで行った。
子どもが「花粉症と診断された」「花粉症だと思う」と回答したのは42・6%で、2014年12月調査の「花粉症である」との回答(32・7%)から約10ポイント増加した。
発症した平均年齢は5・8歳。症状を緩和するための対策で、最も多かったのは「マスクの着用」で60・9%、次いで「病院で処方された飲み薬の使用」が55・4%だった。小学生が感じる症状の第2位が「目のかゆみ」だったが、市販の目薬やメガネの使用などの対策はいずれも3割以下にとどまっていた。
通学や外遊びなどで屋外にいる機会が多い子どもにとって「目のかゆみ」は日常生活への影響が大きい。親から「目のかゆみ」がある小学生に複数回答で状況を聞いてもらったところ、「日常生活に影響がある」と答えたのは53・9%に上り、「授業など勉強に集中できない」が25・6%、「外で遊びを楽しめない」が23%、「夜眠れない」が11%などと深刻な影響が出ていることが判明した。
子どもが感じている目のかゆみによる日常生活への影響について、44・2%の親がこのアンケートに答えるまで把握していなかった内容があったと答えており、一緒に暮らしていても花粉症の影響を把握できていない実態も浮き彫りとなった。【佐久間一輝】
`.pipeTo(
new WritableStream({
write: (content) => {
console.write(content);
},
}),
); // write to console
gpt`...` => resposne...
type gptResponse = ReadableStream<string> & {
[Symbol.AsyncIterable]: ..., // token stream,
readable:
writalbe: // fill to template blanks
response: new response
text: ()=>Promise< string>,
json: ()=>Promise< any>,
then: ()=>Promise< string>,
catch: ()=>Promise<...>, // network error
}
type gpt = (tsa: tsa, slots: srcs)=>gptResponse
### More [./examples HERE](./examples)
## Reference
Inspired by zx & bun shell
FAQs
Talk to ChatGPT in JS TemplateString Style with Streaming Support
The npm package chatgpt-template receives a total of 1 weekly downloads. As such, chatgpt-template popularity was classified as not popular.
We found that chatgpt-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.