<?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: Marvellous</title>
    <description>The latest articles on DEV Community by Marvellous (@marvelcodes).</description>
    <link>https://dev.to/marvelcodes</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F459814%2F5b959a2a-1bc2-428b-8b3f-1dd416a293f5.jpeg</url>
      <title>DEV Community: Marvellous</title>
      <link>https://dev.to/marvelcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marvelcodes"/>
    <language>en</language>
    <item>
      <title>Build a Pear Protocol DeFi trading agent with MCP</title>
      <dc:creator>Marvellous</dc:creator>
      <pubDate>Sat, 18 Jul 2026 23:35:46 +0000</pubDate>
      <link>https://dev.to/marvelcodes/build-a-pear-protocol-defi-trading-agent-with-mcp-499o</link>
      <guid>https://dev.to/marvelcodes/build-a-pear-protocol-defi-trading-agent-with-mcp-499o</guid>
      <description>&lt;p&gt;If you want an AI agent that can actually &lt;em&gt;trade&lt;/em&gt;, not just chat about charts, the Model Context Protocol (MCP) is the cleanest way to wire a model to a real exchange. This post builds a &lt;strong&gt;Pear Protocol&lt;/strong&gt; DeFi trading agent: one that can browse pair markets, read your positions and portfolio, and (when you turn it on) open and close leveraged &lt;strong&gt;pair trades on Hyperliquid&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We'll use &lt;a href="https://github.com/MarvelNwachukwu/mcp-pear" rel="noopener noreferrer"&gt;&lt;code&gt;mcp-pear&lt;/code&gt;&lt;/a&gt;, an open-source MCP server that wraps Pear Protocol's API.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Pear Protocol?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://pearprotocol.io" rel="noopener noreferrer"&gt;Pear Protocol&lt;/a&gt; is a Hyperliquid-backed platform for &lt;strong&gt;pair trading&lt;/strong&gt;. You go long one basket and short another in a single position, and profit from the &lt;em&gt;ratio&lt;/em&gt; between them moving your way, regardless of overall market direction. Classic example: long ETH, short BTC if you think ETH outperforms, without betting on crypto as a whole.&lt;/p&gt;

&lt;p&gt;Pear settles on Hyperliquid, so every pair position is really a pair of perp legs executed on-chain.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP, and why use it here?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Model Context Protocol&lt;/strong&gt; is an open standard that lets an LLM call external tools through one uniform interface. Instead of gluing Pear's REST API to your model by hand, you run an MCP server that &lt;em&gt;describes&lt;/em&gt; its tools to the model, and any MCP client (Claude Desktop, Cursor, Cline, or your own agent) can use them.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mcp-pear&lt;/code&gt; exposes Pear as a set of MCP tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public (no auth):&lt;/strong&gt; &lt;code&gt;list_markets&lt;/code&gt;, &lt;code&gt;get_active_markets&lt;/code&gt;, &lt;code&gt;get_pair_ratio&lt;/code&gt;, &lt;code&gt;get_health&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authenticated read:&lt;/strong&gt; &lt;code&gt;get_open_positions&lt;/code&gt;, &lt;code&gt;get_open_orders&lt;/code&gt;, &lt;code&gt;get_portfolio&lt;/code&gt;, &lt;code&gt;get_trade_history&lt;/code&gt;, &lt;code&gt;get_account_summary&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write (opt-in):&lt;/strong&gt; &lt;code&gt;open_position&lt;/code&gt;, &lt;code&gt;close_position&lt;/code&gt;, &lt;code&gt;adjust_position&lt;/code&gt;, &lt;code&gt;adjust_leverage&lt;/code&gt;, &lt;code&gt;set_risk_parameters&lt;/code&gt;, &lt;code&gt;cancel_order&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: run the server
&lt;/h2&gt;

&lt;p&gt;No install needed. &lt;code&gt;npx&lt;/code&gt; fetches it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx &lt;span class="nt"&gt;-y&lt;/span&gt; @marvelcodes/mcp-pear@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The public tools work with zero config, so your agent can browse markets and pair ratios right away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: wire it into Claude Desktop
&lt;/h2&gt;

&lt;p&gt;Add this to your Claude Desktop MCP config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"pear"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@marvelcodes/mcp-pear@latest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart Claude and ask: &lt;em&gt;"What are the top gaining pair markets on Pear right now?"&lt;/em&gt; It calls &lt;code&gt;get_active_markets&lt;/code&gt; and answers from live data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: add your account (read tools)
&lt;/h2&gt;

&lt;p&gt;To read &lt;em&gt;your&lt;/em&gt; positions and portfolio, mint a Pear API key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx &lt;span class="nt"&gt;-y&lt;/span&gt; @marvelcodes/mcp-pear@latest setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This opens a browser, asks you to sign once with your wallet, and writes &lt;code&gt;PEAR_API_KEY&lt;/code&gt; + &lt;code&gt;PEAR_ADDRESS&lt;/code&gt;. Add them to the config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"pear"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@marvelcodes/mcp-pear@latest"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"PEAR_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your_key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"PEAR_ADDRESS"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xyour_address"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;em&gt;"How's my portfolio doing this week?"&lt;/em&gt; works. It calls &lt;code&gt;get_portfolio&lt;/code&gt; with your real PnL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: let the agent trade (carefully)
&lt;/h2&gt;

&lt;p&gt;Trade execution is &lt;strong&gt;off by default&lt;/strong&gt;. You opt in on purpose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"PEAR_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your_key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"PEAR_ADDRESS"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0xyour_address"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"PEAR_TRADE_ENABLED"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"true"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that flag set, the agent can call &lt;code&gt;open_position&lt;/code&gt;. A pair trade looks like this: long ETH, short BTC, 3x, $100 notional.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"executionType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"MARKET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"leverage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"usdValue"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"slippage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"longAssets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"asset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ETH"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"weight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"shortAssets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"asset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BTC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"weight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;open_position&lt;/code&gt; also takes &lt;code&gt;TRIGGER&lt;/code&gt;, &lt;code&gt;TWAP&lt;/code&gt;, and &lt;code&gt;LADDER&lt;/code&gt; execution types, plus attached &lt;code&gt;stopLoss&lt;/code&gt; / &lt;code&gt;takeProfit&lt;/code&gt;. Pear signs the trade server-side, so &lt;strong&gt;the MCP server never holds your private keys&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Two Hyperliquid gotchas worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;~$10 minimum notional&lt;/strong&gt; per order. Smaller orders get rejected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spot vs Perps balance.&lt;/strong&gt; USDC bridged onto Hyperliquid often lands in your &lt;em&gt;Spot&lt;/em&gt; balance. Move it to &lt;em&gt;Perps&lt;/em&gt; first or &lt;code&gt;open_position&lt;/code&gt; fails with insufficient margin.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Putting it together
&lt;/h2&gt;

&lt;p&gt;Here's the shape of an agent loop that uses it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;get_active_markets&lt;/code&gt; to find pairs with strong momentum&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_pair_ratio&lt;/code&gt; to check the current ratio and funding&lt;/li&gt;
&lt;li&gt;Model decides direction&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;open_position&lt;/code&gt; with a stop-loss attached&lt;/li&gt;
&lt;li&gt;Poll &lt;code&gt;get_open_positions&lt;/code&gt;, then &lt;code&gt;close_position&lt;/code&gt; when the thesis plays out&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Everything is a tool call, so the model reasons over live data and acts. No custom API glue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safety notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep &lt;code&gt;PEAR_TRADE_ENABLED&lt;/code&gt; off until you've tested read-only behaviour.&lt;/li&gt;
&lt;li&gt;Start with tiny notionals.&lt;/li&gt;
&lt;li&gt;The write tools execute real trades with real money. Constrain the agent, monitor it, and set risk parameters like you would any trading bot.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/MarvelNwachukwu/mcp-pear" rel="noopener noreferrer"&gt;https://github.com/MarvelNwachukwu/mcp-pear&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/@marvelcodes/mcp-pear" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@marvelcodes/mcp-pear&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pear Protocol: &lt;a href="http://pear.garden/" rel="noopener noreferrer"&gt;http://pear.garden/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;mcp-pear&lt;/code&gt; is an independent, open-source community project, not affiliated with Pear Protocol. PRs and issues welcome.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>defi</category>
      <category>hyperliquid</category>
    </item>
    <item>
      <title>Converting CSV to JSON: A Quick Guide + An Online Tool</title>
      <dc:creator>Marvellous</dc:creator>
      <pubDate>Thu, 26 Sep 2024 14:19:55 +0000</pubDate>
      <link>https://dev.to/marvelcodes/converting-csv-to-json-a-quick-guide-an-online-tool-35im</link>
      <guid>https://dev.to/marvelcodes/converting-csv-to-json-a-quick-guide-an-online-tool-35im</guid>
      <description>&lt;p&gt;CSV (Comma-Separated Values) is a widely used format for storing tabular data, often seen in spreadsheets and data exchanges. While CSV is simple and effective for data storage, JSON (JavaScript Object Notation) has become the go-to format for working with structured data in web applications. Whether you're building APIs, importing/exporting data, or simply working on a JavaScript-heavy project, converting CSV to JSON is a common need.&lt;/p&gt;

&lt;p&gt;In this article, I'll walk you through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What CSV and JSON formats are&lt;/li&gt;
&lt;li&gt;Why converting CSV to JSON is important&lt;/li&gt;
&lt;li&gt;How to easily convert CSV to JSON&lt;/li&gt;
&lt;li&gt;Introducing &lt;a href="https://csvtojson.marvellous.codes/" rel="noopener noreferrer"&gt;csvtojson.marvellous.codes&lt;/a&gt; – a free online tool I built for quick conversions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is CSV?
&lt;/h2&gt;

&lt;p&gt;CSV files are plain text files that store data in rows and columns. Each line in the file represents a row, and values within the row are separated by commas. It’s a popular format for data exchange because it's simple and compatible with many tools and applications.&lt;/p&gt;

&lt;p&gt;Example of a CSV file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name, Age, Occupation
Alice, 30, Developer
Bob, 25, Designer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is JSON?
&lt;/h2&gt;

&lt;p&gt;JSON, on the other hand, is a lightweight data-interchange format that's easy to read and write for both humans and machines. It's widely used in web development for transmitting data between a server and a web application, especially in REST APIs.&lt;/p&gt;

&lt;p&gt;Example of a JSON file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Occupation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Developer"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bob"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Occupation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Designer"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Convert CSV to JSON?
&lt;/h2&gt;

&lt;p&gt;While CSV is great for basic data storage and exchange, JSON is the preferred format for modern web applications because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript Friendly&lt;/strong&gt;: JSON integrates seamlessly with JavaScript, making it easier to work with in front-end frameworks like React, Vue, and Angular.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nested Data&lt;/strong&gt;: JSON supports hierarchical and complex structures, unlike CSV which is limited to flat data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readability&lt;/strong&gt;: JSON is often more readable and structured, which is beneficial when dealing with large datasets or APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Methods to Convert CSV to JSON
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Manual Conversion
&lt;/h3&gt;

&lt;p&gt;For small datasets, you could manually rewrite CSV data into JSON format. However, this can be time-consuming and error-prone.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Using Code
&lt;/h3&gt;

&lt;p&gt;There are many ways to programmatically convert CSV to JSON using different languages and libraries.&lt;/p&gt;

&lt;p&gt;For instance, in JavaScript:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;csv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;csvtojson&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;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;input.csv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;jsonObj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;output.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jsonObj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method works well for developers familiar with coding, but for non-developers or those seeking a quick, no-code solution, a web-based tool is more practical.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Using Online Tools
&lt;/h3&gt;

&lt;p&gt;For those who don't want to deal with code or install libraries, online tools provide an easy and quick solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing &lt;a href="https://csvtojson.marvellous.codes/" rel="noopener noreferrer"&gt;csvtojson.marvellous.codes&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To simplify the CSV to JSON conversion process, I built &lt;a href="https://csvtojson.marvellous.codes/" rel="noopener noreferrer"&gt;csvtojson.marvellous.codes&lt;/a&gt;, a free and easy-to-use web tool that does the heavy lifting for you. No need to install software or write code – just upload your CSV file and download the JSON output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Use csvtojson.marvellous.codes?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fast &amp;amp; Free&lt;/strong&gt;: Upload your CSV, get your JSON – simple!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Installation&lt;/strong&gt;: Access the tool from any browser without worrying about installations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open &amp;amp; Transparent&lt;/strong&gt;: The tool is straightforward, and your data isn’t stored after conversion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For Developers and Non-Developers&lt;/strong&gt;: Whether you're a seasoned developer or someone just looking to convert a CSV file quickly, this tool fits your needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use It
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Visit &lt;a href="https://csvtojson.marvellous.codes/" rel="noopener noreferrer"&gt;csvtojson.marvellous.codes&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Upload your CSV file.&lt;/li&gt;
&lt;li&gt;Click "Convert".&lt;/li&gt;
&lt;li&gt;Download the JSON file generated.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It’s as simple as that!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Converting CSV to JSON is a common task in web development, especially when working with APIs and JavaScript applications. Whether you choose to use code or tools like &lt;a href="https://csvtojson.marvellous.codes/" rel="noopener noreferrer"&gt;csvtojson.marvellous.codes&lt;/a&gt;, understanding both formats is essential for modern data handling.&lt;/p&gt;

&lt;p&gt;Give the tool a try, and feel free to share any feedback. Happy coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>json</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to create a container component</title>
      <dc:creator>Marvellous</dc:creator>
      <pubDate>Tue, 09 Aug 2022 12:45:00 +0000</pubDate>
      <link>https://dev.to/marvelcodes/how-to-create-a-container-components-ah</link>
      <guid>https://dev.to/marvelcodes/how-to-create-a-container-components-ah</guid>
      <description>&lt;p&gt;Need to create a component that can take in other components/elements as children or just a component that wraps your app? Well you're in luck, here's a short tutorial on how to do it.&lt;/p&gt;

&lt;p&gt;A really straight to the point answer is having your component have a prop with a type &lt;code&gt;JSX.Element&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Card = ({ children }: { children: JSX.Element }) =&amp;gt; {
  return (
     &amp;lt;div&amp;gt;
       { children }
     &amp;lt;/div&amp;gt;
  );
};

export default function App() {
  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;h1&amp;gt;Hello CodeSandbox&amp;lt;/h1&amp;gt;
      &amp;lt;h2&amp;gt;Start editing to see some magic happen!&amp;lt;/h2&amp;gt;

      &amp;lt;Card&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;This Component can take children&amp;lt;/h2&amp;gt;
      &amp;lt;/Card&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>nextjs</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Fixing ClassName did not match error</title>
      <dc:creator>Marvellous</dc:creator>
      <pubDate>Wed, 09 Mar 2022 20:33:32 +0000</pubDate>
      <link>https://dev.to/marvelcodes/fixing-classname-did-not-match-error-3b8k</link>
      <guid>https://dev.to/marvelcodes/fixing-classname-did-not-match-error-3b8k</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Warning: Prop `className` did not match. Server: Client:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is probably one of the most annoying problem with Next.js, Typescript and styled-component luckily there's a work around for this.&lt;/p&gt;

&lt;p&gt;You're gonna need to install babel-plugin-styled-components&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add --dev babel-plugin-styled-components
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file named .babelrc in the root directory and configure it. Here's the config file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "presets": [
        "next/babel"
    ],
    "plugins": [
        [
            "styled-components",
            {
                "ssr": true,
                "displayName": true,
                "preprocess": false
            }
        ]
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart your server and refresh your server and you should be good. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vercel/next.js/issues/7322" rel="noopener noreferrer"&gt;Here's the issue on Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ciao&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>styledcomponent</category>
      <category>react</category>
    </item>
    <item>
      <title>CSS StyleSheets</title>
      <dc:creator>Marvellous</dc:creator>
      <pubDate>Wed, 09 Dec 2020 14:52:03 +0000</pubDate>
      <link>https://dev.to/marvelcodes/css-stylesheets-pn9</link>
      <guid>https://dev.to/marvelcodes/css-stylesheets-pn9</guid>
      <description>&lt;p&gt;The browser has a basic style sheet that gives a default style to any document. These style sheets are named user-agent stylesheets. Some browsers use actual style sheets for this purpose, while others simulate them in code, but the end result is the same.&lt;/p&gt;

&lt;p&gt;Some browsers let users modify the user-agent stylesheet. Although some constraints on user-agent stylesheets are set by the HTML specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another. To simplify the development process, Web developers often use a CSS reset style sheet, forcing common properties values to a known state before beginning to make alterations to suit their specific needs.&lt;/p&gt;

&lt;p&gt;Author stylesheets are style sheets that define styles as part of the design of a given web page or site. The author of the page defines the styles for the document using one or more stylesheets, which define the look and feel of the website — its theme&lt;/p&gt;

&lt;p&gt;The user (or reader) of the website can choose to override styles in many browsers using a custom &lt;strong&gt;user stylesheet&lt;/strong&gt; designed to tailor the experience to the user's wishes.&lt;/p&gt;

&lt;p&gt;Learn more from &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>responsivecss</category>
    </item>
    <item>
      <title>HTML &amp; CSS Comments</title>
      <dc:creator>Marvellous</dc:creator>
      <pubDate>Sat, 29 Aug 2020 21:46:43 +0000</pubDate>
      <link>https://dev.to/marvelcodes/html-css-comments-3178</link>
      <guid>https://dev.to/marvelcodes/html-css-comments-3178</guid>
      <description>&lt;p&gt;Writing lots of lines of code and you're worried you might not understand your code next week?&lt;/p&gt;

&lt;p&gt;Want to make your project understandable to other programmers? &lt;/p&gt;

&lt;p&gt;Comments are the way to go about it. A comment is a programmer-readable explanation or annotation in the source code of a computer program.&lt;/p&gt;

&lt;p&gt;Comments are added to make the source code easier for humans to understand and are generally ignored by compilers and interpreters.&lt;/p&gt;

&lt;p&gt;Comments are started with a language-specific symbol &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;HTML5&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!--This is a comment --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;CSS&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* This is a comment */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;JavaScript&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//This is a comment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use comments&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"A handy rule of thumb is: a comment should only be added to answer a question that the code can't. If you aren't confused by what a piece of code is doing, but rather why it's doing it at that moment, then a comment should be added." - &lt;a href="https://itnext.io/what-makes-a-good-code-comment-5267debd2c24" rel="noopener noreferrer"&gt;Mark Cronin&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Comments can be placed wherever white space is allowed within a style sheet. They can be used on a single line, or traverse multiple lines. This allows commenting inside a block of code and between a group of codes. What matters is making your code glanceable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* A one-line comment */

/*
A comment
which stretches
over several
lines
*/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Note&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The /* */ comment syntax is used for both single and multiline comments. There is no other way to specify comments in external style sheets.&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>codenewbie</category>
      <category>comments</category>
    </item>
  </channel>
</rss>
