<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ateeb Ur Rahmaan</title>
    <description>The latest articles on DEV Community by Ateeb Ur Rahmaan (@ateebnoone).</description>
    <link>https://dev.to/ateebnoone</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3069405%2F6e5ae83e-aa7a-48ae-94ad-c728b00813bb.jpg</url>
      <title>DEV Community: Ateeb Ur Rahmaan</title>
      <link>https://dev.to/ateebnoone</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ateebnoone"/>
    <language>en</language>
    <item>
      <title>npm-ai-hooks: Inject LLM behavior into any TS function with one line</title>
      <dc:creator>Ateeb Ur Rahmaan</dc:creator>
      <pubDate>Sat, 11 Oct 2025 09:10:10 +0000</pubDate>
      <link>https://dev.to/ateebnoone/npm-ai-hooks-inject-llm-behavior-into-any-ts-function-with-one-line-4e2o</link>
      <guid>https://dev.to/ateebnoone/npm-ai-hooks-inject-llm-behavior-into-any-ts-function-with-one-line-4e2o</guid>
      <description>&lt;p&gt;Hey everyone 👋&lt;/p&gt;

&lt;p&gt;I’ve been working on something I wish existed earlier — &lt;strong&gt;&lt;a href="https://www.npmjs.com/package/npm-ai-hooks" rel="noopener noreferrer"&gt;npm-ai-hooks&lt;/a&gt;&lt;/strong&gt; — a universal AI hook layer for Node.js and TypeScript.&lt;/p&gt;

&lt;p&gt;It lets you inject LLM behavior into &lt;strong&gt;any&lt;/strong&gt; JS/TS function with just one line.&lt;br&gt;
No need to manage SDKs, prompts, or API differences between providers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ai&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;npm-ai-hooks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;summarize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wrap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;summarize&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Node.js is a JavaScript runtime built on Chrome’s V8...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it — you just made a function “AI-aware.”&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 What makes it cool
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Works with &lt;strong&gt;OpenAI, Claude, Gemini, DeepSeek, Groq, Mistral, Perplexity, xAI Grok&lt;/strong&gt;, and &lt;strong&gt;OpenRouter&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Unified interface for all providers&lt;/li&gt;
&lt;li&gt;Built-in tasks: summarize, translate, rewrite, codeReview, explain, etc.&lt;/li&gt;
&lt;li&gt;Handles caching, cost-awareness, and errors automatically&lt;/li&gt;
&lt;li&gt;Fully &lt;strong&gt;open source (MIT)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why I built it
&lt;/h2&gt;

&lt;p&gt;Every AI SDK feels different — with its own setup, auth, and quirks.&lt;br&gt;
I wanted something like &lt;strong&gt;React Hooks&lt;/strong&gt;, but for backend AI logic.&lt;/p&gt;

&lt;p&gt;So now you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const reviewCode = ai.wrap(code =&amp;gt; code, { task: "codeReview" });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and get meaningful results without writing a single prompt.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/RealTeebot/npm-ai-hooks" rel="noopener noreferrer"&gt;https://github.com/RealTeebot/npm-ai-hooks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/npm-ai-hooks" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/npm-ai-hooks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I’d love your thoughts and contributions — new features, provider ideas, or improvements are all welcome.&lt;br&gt;
If you like the concept, try it, star it, and let’s build an AI abstraction layer that just works ✨&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>node</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
