Tumgik
#nodejs
praxis-app · 4 months
Text
Tumblr media
join praxis now - discord - github
2K notes · View notes
windsails · 2 months
Text
ohh!!! i had a really good idea. a social media site with a circular timeline called samsara
22 notes · View notes
izicodes · 11 months
Text
Build Your Own npm Package!
Tumblr media
Hiya! @kitkatcodes made a post a couple days ago essentially her making her own npm package and I thought it was super cool! I've been busy lately but I gave myself some time to read the tutorial she used and play around making my own!
Link to @kitkatcodes post >> LINK
Tumblr media
The npm package
Tumblr media
Here it is! Took me 3 hours to do this because I got the concept of how to make the package following the tutorial @kitkatcodes used (which is this: LINK) but then I got around playing around with the colours and appearance, as I do~! Then I finally finished and published it!
The main code
Tumblr media
Have a go!
If you have Node.js installed, in the terminal, type:
1. npm i xiacodes-business-card 2. npx xiacodes
Then you should see the output shown above!
Tumblr media
Well, that's all! I had fun making this and thanks again to @kitkatcodes for the initial post! It's super easy to do and fun! Here are some links:
GitHub repo: LINK
My npm package page: LINK
The ASCII art site: LINK
The package to add colours to the output text: LINK
Have a nice day and happy coding! 💗💻
70 notes · View notes
imamuffin · 2 months
Text
Tumblr media
// building my portfolio website ...
18 notes · View notes
koshekdev · 8 months
Text
Project update (Next.js) + little API routing tutorial
So my last post was about setting up my back-end using Node.js and Sequelize. After setting everything up it was time to create needed routes and queries. I didn't look too much into how to do it, just made an api folder, made a .ts file for every table I have in my database and filled it with CRUD operations + whatever additional query was needed.
Tumblr media
After writing all of this I wondered how do I define links for all of these operations? Well as it turns out, when you put files in an api folder in Next.js, they generate by themself, meaning all of my crud operations were now under the same /api/file_table_name link. Obviously that's bad news. It took me 2 days of rearranging (it wasn't hard, just boring XD) and I got this structure
Tumblr media
(This is not an entire structure, just a snippet because the whole structure is kinda big and pointless for demonstration)
So now for getting host/api/tag we have an index.ts file which carries the createTag function which requires just a body that contains new tagName.
For host/api/tag/id we have the [id].ts which carries getTagById and DeleteTag function. Now how do we differentiate between those two operations when they are on the same link?
Tumblr media
At the end of your file you should have a handler function for which you write the cases in which certain operation happen. In this case it only depends on the http method, but it is possible to add other cases such as potential query string (the on that start with ? in the link ex. api/posts?sort=asc). Here's the code example from my /stickerpack/[id].ts file
Tumblr media
So this means the link is going to be host/api/stickerpack/id?type="".
What surprised me was that you don't fetch id with req.params.id, but you fetch everything with req.query, and Next.js I guess just figures out what is a parameter and what is not based on the file name. Another surprising thing is the obvious "id as any" situation XD. It did not work any other way. No idea why. I'll look it up when I get the energy.
That's my wisdom for today, if you have any questions feel free to ask me anywhere XD I'm no professional tho lol
26 notes · View notes
devhubby · 9 months
Text
How to Call MySQL Stored Procedures from Node.js?
Tumblr media
Read more at: https://elvanco.com/blog/how-to-call-mysql-stored-procedures-from-node-js
20 notes · View notes
codewithishraq · 2 years
Text
Application Programming Interface (API)
What is API?
API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. It is a way for computers to share data or functionality, but computers need some kind of interface to talk to each other.
When you use an application on your mobile phone, the application connects to the Internet and sends data to a server. The server then retrieves that data, interprets it, performs the necessary actions and sends it back to your phone. The application then interprets that data and presents you with the information you wanted in a readable way. This is what an API is - all of this happens via API.
Building Blocks of API
There are three building blocks of an API. These are:
dataset
requests
response
Let’s elaborate these blocks a bit.
An API needs a data source. In most cases, this will be a database like MySQL, MongoDB, or Redis, but it could also be something simpler like a text file or spreadsheet. The API’s data source can usually be updated through the API itself, but it might be updated independently if you want your API to be “read-only”.
An API needs a format for making requests. When a user wants to use an API, they make a “request”. This request usually includes a verb (eg: “GET”, “POST”, “PUT”, or “DELETE”), a path (this looks like a URL), and a payload (eg: form or JSON data). Good APIs offer rules for making these requests in their documentation.
An API needs to return a response. Once the API processes the request and gets or saves data to the data source, it should return a “response”. This response usually includes a status code (eg: “404 - Not Found”, “200 - Okay”, or “500 - Server Error”) and a payload (usually text or JSON data). This response format should also be specified in the documentation of the API so that developers know what to expect when they make a successful request.
Types of API
Open APIs - Also known as Public APIs. These APIs are publicly available and there are no restrictions to access them.
Partner APIs - These APIs are not publicly available, so you need specific rights or licenses to access them.
Internal APIs - Internal or private. These APIs are developed by companies to use in their internal systems. It helps you to enhance the productivity of your teams.
Composite APIs - This type of API combines different data and service APIs.
SOAP - It defines messages in XML format used by web aplications to comunicate with each other.
REST - It makes use of HTTP to GET, POST, PUT or DELETE data. It is basically used to take advantage of the existing data.
JSON-RPC - It uses JSON for data transfer and is a light-weight remote procedural call defining few data structure types.
XML-RPC - It is based on XML and uses HTTP for data transfer. This API is widely used to exchange information between two or more networks.
Features of API
It offers a valuable service (data, function, audience).
It helps you to planabusiness model.
Simple, flexible, quickly adopted.
Managed and measured.
Offers great developer support.
Examples of API
Razorpay API
Google Maps API
Spotify API
Twitter API
Weather API
PayPal API
PayTm API
HubSpot API
Youtube API
Amazon's API
Travel Booking API
Stock Chart API
API Testing Tools
Postman - Postman is a plugin in Google Chrome, and it can be used for testing API services. It is a powerful HTTP client to check web services. For manual or exploratory testing, Postman is a good choice for testing API.
Ping API - Ping API is API testing tool which allows us to write test script in JavaScript and CoffeeScript to test your APIs. It will enable inspecting the HTTP API call with a complete request and response data.
VREST - VREST API tool provides an online solution for automated testing, mocking, automatic recording and specification of REST/HTTP APIS/RESTful APIs.
When to create an API and when not to
Its very important to remember when to create and when not to create an API. Let’s start with when to create an API…
You want to build a mobile app or desktop app someday
You want to use modern front-end frameworks like React or Angular
You have a data-heavy website that you need to run quickly and load data without a complete refresh
You want to access the same data in many different places or ways (eg: an internal dashboard and a customer-facing web app)
You want to allow customers or partners limited or complete access to your data
You want to upsell your customers on direct API access
Now, when not to create an API…
You just need a landing page or blog as a website
Your application is temporary and not intended to grow or change much
You never intend on expanding to other platforms (eg: mobile, desktop)
You don’t understand the technical implications of building one.
A short 30 second clip to understand it
instagram
Word of advice for newbies
Please don’t wait for people to spoon-feed you with every single resource and teachings because you’re on your own in your learning path. So be wise and learn yourself.
About Me
I am Ishraq Haider Chowdhury from Bangladesh, currently living in Bamberg, Germany. I am a fullstack developer mainly focusing on MERN Stack applications with JavaScript and TypeScript. I have been in this industry for about 9 years and still counting. If you want to find me, here are some of my social links....
Instagram
TikTok
YouTube
Facebook
Twitter
GitHub
179 notes · View notes
codemerything · 6 months
Text
NPM vs NPX
During my first attempt at using React, I was following the installation instructions on the documentation which recommended using the command "npx create-react-app <my-app>". It was then that I realized I was not entirely sure about the difference between npm and npx, as I had been using them interchangeably without fully understanding their functions beyond package installation. This realization inspired me to write an article about the topic. A great explanation lies at the end of the article. Trust!
10 notes · View notes
why-tap · 1 year
Text
Tumblr media
WHY tap
28 notes · View notes
funnycoder · 8 months
Text
Tumblr media
Lmao
15 notes · View notes
praxis-app · 5 months
Text
Tumblr media
join the praxis discord - mastodon - github
550 notes · View notes
linuxtldr · 12 days
Text
2 notes · View notes
izicodes · 1 year
Text
Coding Night Classes Completed!
Tumblr media Tumblr media
After 16 long weeks of coding classes, I have finally submitted my last assignment! Tonight is the last "class" but we will just be reflecting on the whole class overall and what to do next in terms of working using our experience from the class.
I'm just happy I get to pass because I was looking at my overdue homework and thinking "Yeah, I don't know if I can complete this in time" and on the very last day... I did it!
Now I am waiting for the digital certificate which will come next week! Super proud of myself and thanks to everyone who told me to complete the classes even though I wanted to quit 🤣💗
Tumblr media
Anyone wondering AND is in the UK, I did the 'Trilogy’s Skills Bootcamp in Front-End Web Development' LINK - they give career advice throughout the 16 weeks and I believe 3 months after the BootCamp is done!
107 notes · View notes
priyanshu2002 · 1 month
Video
youtube
Build a Real-Time Chat App with Socket.IO | Node.js
2 notes · View notes
vidadelafuerza · 2 months
Text
JavaScript Node.js PowerShell JSON Repeat
Lately, I've taken a lot of time to reacquaint myself with JavaScript usage in Node.js. Specifically, I'm learning all the basic things I enjoy doing in PowerShell: File manipulation (list, read, write) and data manipulation (parse, extract, interpret, summarize).
Specifically, my favorite thing is to see something of interest on a website and/or analyze a website's requests in the Network tab of DevTools (CTRL+SHIFT+I). It has to be something useful. Such things can be scraped for data I might want. The way I do that is in the Network tab of DevTools (Chrome, MS Edge). Looking at a request, I can right click and get the PowerShell (or other code) that would give me that exact same information in Windows Terminal. Then, I typically do an ad-hoc script to get what I want.
Current Web Scrape++ Project
The project that has my interest at the moment is one where I'm taking all the text of a copyrighted version of the Bible, then using DOM queries and JavaScript to get just the verse numbers and verse text per chapter from the HTML. It sounds as complicated as it is, but it's the kind of thing I do for fun.
Node.js comes into play when I want to loop through all the HTML I've pulled and sanitized. The sanitization wasn't easy. I kept only the HTML with actual Bible text - which reduced the HTML payload to less than 2% its original size. That part was in PowerShell and Visual Studio Code. But I digress.
Using the Console of DevTools, I already have the JavaScript I'll need to pull what I want from the HTML file data into an array of "verse" objects, which I can then easily translate to JSON and write out.
Next, my goal is to take the data, store it as JSON files, and then manipulate it with PowerShell. For instance, I wonder what it looks like if I replace the word "Lord" with "Earl" or "Duke". As silly as that sounds, that's the entire modus operandi for my project, which has been maybe as much as 6 to 8 hours. The rest probably won't take that long, but each step has to be pursued with the smallest steps I can think to make. (There's no use looping 1189 chapters / files of HTML text to get erroneous stuff, so I go small and then large.)
2 notes · View notes
urmverma0202 · 4 months
Text
Tumblr media
New frameworks and tools are constantly being developed in the tech sector, which is a dynamic industry. By nature, Full Stack developers are used to lifelong learning. This flexibility is an essential quality in a field where keeping up with emerging technologies is critical. Taking a Full Stack course fosters an attitude of lifelong learning and development.
Web: https://trumpbookusa.com/blogs/36784/The-Strong-Arguments-for-Enrolling-in-a-Full-Stack-Course
4 notes · View notes