teleren/devto huggingface dataset:
Node.js v10 Is Being End-of-Lifed Today, but What Does It All Mean?
Tags: javascript, node, beginners
Published: 2021-04-30 17:07:39

---
title: Node.js v10 Is Being End-of-Lifed Today, but What Does It All Mean?
published: true
description: Any Node.js end-of-life day is a good day, but today especially so! Node.js 10 is being end-of-lifed today, so you can finally support ES6 imports in your JavaScript code examples and libraries by default!
tags: javascript, node, beginners,
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fcvpqldizrzcd1hw6r5a.png
---

Any Node.js end-of-life day is a good day, but today especially so! Node.js v10 is being end-of-lifed today, so you can finally support ES6 imports in your JavaScript code examples and libraries by default!

The latest versions of Node.js v12 (not the earlier versions, mind you) support ES6 modules by default, so there is no need to do the ugly hacks you needed to do before if you wanted to write modern JavaScript.

## Before

Before, you had to save your code a `.mjs` instead of `js`, and then run `node` with the `--experimental-modules` flag. Which most Node.js runtimes online were very slow to adopt.

`$ node --experimental-modules index.mjs`

## After

The latest versions of Node.js v12+ support this out of the box, so there is no need to run with a flag. And most Node.js runtimes update to the latest Maintenance release, so they support it as well.

If you want to run on your own hosted environment now you can either:
- save the file with a `.mjs` extension, and run it regularly with `node index.mjs`
- save the file with a regular `.js` extension, add `type: module` to your `package.json` file, and then run the file regularly with `node index.js`

## Changing Old Code

If you're migrating from the old `require` to the more modern `import`, there are a couple of things you'll need to do to your files:

- change `module.exports = avocados` into `export default avocados`
- change `const avocados = require('avocados')` into `import avocados from 'avocados'`

Most IDEs account for this and help you change it. Like [VS Code](https://umaar.com/dev-tips/222-vs-code-convert-es-import/).

If you want to see it in action on a slightly bigger project, I've switched over the Fidel sample application using things like express, dotenv and axios a little while back, [it's all contained in a commit](https://github.com/FidelLimited/fidel-api-sample-app/commit/300f672b5d119d9d80afe07ac23f67b3bb52f805) thought so easy to see the changes.


## Wait, What is End-of-Life?

"End-of-life" or EOL is a term used by older, more enterprise-focused companies, to let everyone know that they're limiting support or outright not supporting a certain version of their product anymore. You could say the OpenJS Foundation has "pulled the plug" on Node.js v10. 😅

## Got Love?

If you've loved the pun at the end, or if you just found this mildly useful, please consider [following me on Twitter](https://twitter.com/lakatos88). I'd be storked. 😅
Playing with execution flows in Ruby
Tags: ruby, flow
Published: 2021-04-30 17:05:11

Let's define a simple _Result_ class:

```ruby
class Result
  def initialize(success: true, data: nil); @success = success; @data = data; end
  def success?; @success == true; end
  def error?; !success?; end
  def data; @data; end
  def self.success(data = nil); new(data: data); end
  def self.error(data = nil); new(success: false, data: data); end
end
```

and then a _Flow_ class:

```ruby
class Flow
  attr_accessor :tasks, :result

  def initialize(tasks: [])
    self.tasks = tasks
    self.result = nil
  end

  def step(task)
    self.tasks << task
  end

  def call
    tasks.each do |task|
      begin
        self.data = task.call
        self.result = Result.success(data) unless result.kind_of?(Result)
      rescue => exception
        self.result = Result.error(exception)
      end
      return result if result.error?
    end

    result
  end
end
```

We can now do some interesting things such as:

```ruby
flow = Flow.new
flow.step -> { puts '#1' }
flow.step -> { puts '#2'; 3 * 3 }
flow.step -> { puts '#3 (error)'; raise 'foo' }
flow.step -> { puts '#4' }
result = flow.call

result.error? # => true
result.data # => #<RuntimeError: foo>
```
NodeJS/Express Rest APIs + Bootstrap Table + Ajax JQuery example
Tags: node, express, jquery, ajax
Published: 2021-04-30 16:51:48

https://grokonez.com/frontend/nodejs-express-rest-apis-bootstrap-table-ajax-jquery

NodeJS/Express Rest APIs + Bootstrap Table + Ajax JQuery example

In the tutorial, we show how to use Bootstrap Table & Ajax JQuery to show data from NodeJS/Express RestAPIs.

Related posts:
- <a href="https://grokonez.com/node-js/integrate-nodejs-express-jquery-ajax-post-get-bootstrap-view">Integrate NodeJS/Express – JQuery Ajax POST/GET – Bootstrap view</a>
- <a href="https://grokonez.com/node-js/nodejs-restapis-how-to-create-nodejs-express-restapis-post-get-put-delete-requests">NodeJs/Express RestAPIs – POST/GET/PUT/DELETE requests</a>

<!--more-->
<h2>Goal</h2>
We create a NodeJS/Express project as below structure:

<pre><code class="language-javascript">
/NodeJS-Express-Ajax-JQuery-Bootstrap-Table
	/app
		/controllers
			customer.controller.js
		/routes
			customer.route.js
	/node_modules
	/resources
		/static
			/jquery
				ajaxLoadData.js
	/views
		404.html
		index.html
	package.json
	package-lock.json
	server.js
</code></pre>

Run above project then makes a request <code>http://localhost:8081</code>:

-> Bootstrap view:

<img src="https://grokonez.com/wp-content/uploads/2018/05/NodeJS-Express-Ajax-JQuery-Bootstrap-Table-view.png" alt="NodeJS-Express-Ajax-JQuery-Bootstrap-Table-view" width="676" height="342" class="alignnone size-full wp-image-12247" />
<h2>Practice</h2>
<h3>Setting up NodeJS/Express project</h3>
Create a folder 'NodeJS-Express-Ajax-JQuery-Bootstrap-Table':

More at:

https://grokonez.com/frontend/nodejs-express-rest-apis-bootstrap-table-ajax-jquery

NodeJS/Express Rest APIs + Bootstrap Table + Ajax JQuery example
NestJS Jaeger(and others) Tracing Module for microservices. You'll loved it! ❤️
Tags: nestjs, jaeger, tracing, node
Published: 2021-04-30 16:41:49

---
title: NestJS Jaeger(and others) Tracing Module for microservices. You'll loved it! ❤️
published: true
description: Tracing module for NestJS, a progressive node.js framework written in Typescript, it helps your project be traced with ease.
tags: nestjs, jaeger, tracing, nodejs
//cover_image: https://direct_url_to_image.jpg
---

Once my team have to track the application behavior after it had been deployed to production for a few months. We are looking for an easy way to add the tracing things on top of production-ready application. so we developed this package. [nestjs-jaeger-tracing](https://github.com/dollarsignteam/nestjs-jaeger-tracing).

To use this module, you just import `TracingModule` to your AppModule and initiate with `forRoot()` to add app level interceptor to deserialize microservice payload. Then add serializer which will inject tracing id to payload, like this.

```ts
import { TracingModule } from '@dollarsign/nestjs-jaeger-tracing';
import { Module } from '@nestjs/common';
import { ClientsModule, Transport } from '@nestjs/microservices';

@Module({
  imports: [
    TracingModule.forRoot({
      exporterConfig: {
        serviceName: 'core-service', // service name that will be shown in jaeger dashboard
      },
      isSimpleSpanProcessor: true, // true for development.
    }),
    ClientsModule.register([
      {
        name: 'MATH_SERVICE',
        transport: Transport.TCP,
        options: {
          port: 3001,
          ...TracingModule.getParserOptions(), // this method will return serializer that inject tracing id to microservice payload.
        },
      },
    ]),
  ],
})
export class AppModule {}
```

Now, your application will be sent data to jaeger agent so you can trace your application in Jaeger Dashboard. hurayyyy!

It has so much work to do more, so feel free to use and contribute for your works.
Get any SVG on a web page
Tags: webdev, javascript, image, frontend
Published: 2021-04-30 16:36:33

Sometimes it is useful to get SVGs from a web page, but sometimes it can be complicated to get them. That's why I propose you a trick that allows you to retrieve all the SVG on a web page thanks to javascript. Don't be afraid, no javascript skills are required here. 
The following procedure is easier to do on Chromium browsers even if it is possible with Mozilla Firefox. In my case, I will illustrate the procedure with Chromium.

- First of all you will create a new bookmark, to do so, go to this url in your Chrome/Chromium browser : chrome://bookmarks/

- Then click on "Add new bookmark", as shown in the image

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7g0pd3hjcxprp32o90wc.PNG)

- You give it the name you want (ex : get SVG)

- In url you enter this JS code :
`javascript:javascript: (function () { var e = document.createElement('script'); e.setAttribute('src', 'https://nytimes.github.io/svg-crowbar/svg-crowbar.js'); e.setAttribute('class', 'svg-crowbar'); document.body.appendChild(e); })();`
 
- Then you click on "SAVE".

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wmdjngyh6aam19z2zjsv.PNG)

- Then go to a page from which you want to retrieve an SVG, for example the W3Scholls page on vectors: https://www.w3schools.com/graphics/svg_intro.asp

- You click on the bookmark previously saved

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/btpz32k4rpldkrba1rel.PNG)

- Here, either there are several of them and it gives you a summary of the vector images found on the page, or there is only one and it offers you to download it

- You are now able to download all the vector images!
What Does A Selenium Developer Do?
Published: 2021-04-30 16:34:04

Well, what does a Selenium developer do? except for software testing depends on a lot of factors like the company he/she working for, the work experience they have, the kind of project or task is given, etc. but let me generalize a few points for you that every Selenium tester does in his day-to-day job:

<a href="https://intellipaat.com/blog/tutorial/selenium-tutorial/introduction/">Selenium</a> testing developers need to assess and analyze various requirements of the businesses to help them determine the best strategy for automated testing.

They workout new software test scripts. Along with maintaining all the test scripts suites.

And if they happen to be a senior Selenium tester with immense experience, then they should help and guide the upcoming selenium testers in their organization, and much more pertaining to the task at hand.

Check out the <a href="https://intellipaat.com/selenium-training/">Selenium training</a> course and become a certified Selenium tester to help you set yourself apart from the crowd. As candidates with valuable certifications have the key to better job opportunities in the IT field. Do take a look at our free video on How to Become Selenium Developer in 2021 to get your basics correct about the learning path.
Learn: Why It Took So Long to Finish The Side Project
Tags: learn, story, sideprojects, codenewbie
Published: 2021-04-30 16:04:16

We may have heard the phrase that *"coming up with a new idea for a side project is easier than getting it done"*.

And it actually happens to most of us.

Before we move too far, let me share a bit of my story when I'm about to rebuild my personal portfolio. For version one, it was completed last year. But I was decided to migrate the entire tech-stacks. The main reason was, this version only uses the basic knowledge to build it: HTML and CSS.

With the increasing features that will be presented on this project, I think I have to migrate to a framework that can handle 'the heavier work' in the future. Since I was planning to add it.

From here, I realize there will be some roadblocks that may occur. So, here are some suggestions from me if you may facing the same roadblocks:

1. **Set the priority of this side project**. If it looks like it will take up a lot of time to work on, plan carefully in terms of how much time will you spend on it. Don't let the side project took away so much time in your life.

2. **Learn about the technologies to be used**. Make sure that at least you are familiar with the technologies. One thing you have to believe that migration in the middle of the process is a bad idea.

3. **Determine the purpose in mind**. In order to avoid a side project that sinking in the middle of its journey, there are generally three things as a goal — to learn something, to develop a specific product, or to show up your skill.

Because in the end, as all things should be, *done is better than perfect*.
Metronome CodePen
Tags: codepen, metronome, javascript
Published: 2021-04-30 16:13:10

#Just created a musical metronome codepen.

It can play a give cycle of n bars at in- or decreasing speed (beats per minute). Created for musical practicing purposes ;-)

Check it out: https://codepen.io/jan-koehoorn/pen/abpgvmO
Info on which Web Framework to use for a small BE/FE web project
Tags: info, help, question
Published: 2021-04-30 15:59:26

---
title: Info on which Web Framework to use for a small BE/FE web project
published: true
description: 
tags: info, help, question
//cover_image: https://direct_url_to_image.jpg
---

Hi, I am mainly a php backend developer (using Laravel and Symfony), I'd like to build a couple small project with these features:

* social login
* database interaction
* FE is mainly an intro page, login/logout/profile functionality, and a logged page with a form and little more
* BE needs just to make some basic CRUD operations from a logged user

I can easily do this using Laravel and Bootstrap but I was wondering if there is something that could allow me to develop it even faster - I'm thinking of some scaffolded framework (analogue to a JetStream Laravel app) that already provides those features out of the box.

Ideally the frontend would be modern looking but without me having to learn some JS library from scratch - I was looking to Tailwind and I like it, only I cannot for the life of me make layouts as easily as bootstrap columns.

As you guessed, I cannot dedicate much time to these projects...that's why I was searching for somethiing that would yeald me an MVP after a few hours of programming, without frustration...

Do you have experience of something like this?

Searching for "Web frameworks" or similar keeps returning useless blog posts with the same useless list of things (take this for ex.: "6 javascript framework for 2021: react,node.js, bootstrap,jquery, angular, backbone". Come on...). Ideally something I can deploy easily with docker.

Google Firebase is intriguing me but I cannot understand how to actually build something using those services 😅

Thanks a lot!
World of Tanks boosting service
Published: 2021-04-30 15:55:36

Hello. I wanted to share my find. By the way, are there any fans of World of Tanks here? If you love WoT so much, then you should buy WoT account boosting by https://boost-hub.com/catalog/world-of-tanks/. Having a good boosted account, you can be in the club of top players, which means that you may even be able to meet your idols. Anyway, you can play with very cool players, thereby gaining experience and new valuable knowledge. I play WoT and my account is boosted now. I advise you too.
import & require
Published: 2021-04-30 15:55:01


<h1>fix: SyntaxError: Cannot use import statement outside a module</h1>
Follow is ok.
```javascrit
let test = require('mathjs')

let result = test.round(3.12484, 3)               

console.log(result)
```
But import syntax is error:
```javascipt
import { round } from 'mathjs'
let test = round(3.1515,2)
console.log(test)
```
<h1>Solution :</h1>
<h2>In your package.json file, simply add “type”:“module” to fix this issue :</h2>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8p6vco1qup31e69w23ng.png)

<h2>Or you can add the below line in your main entry JS file:</h2>

```html
<script type="module" src="main.js"></script>
```
Clean Code #1 : React, Javascript
Tags: javascript, react, webdev
Published: 2021-04-30 15:41:24

**Example** 

lets say we have a object like below


```
const user = {
  firstName: 'Vijay',
  lastName: 'Singh'
}
```

**Note** : firstName and lastName can be empty string or undefined or null.

```
const fullName = user.firstName 
? ( user.lastName ? `${user.firstName} ${user.lastName}`: user.firstName) 
: user.lastName
```

**Using || Operator**

```
const fullName = `${user.firstName || '' } ${user.lastName || ''}`.trim()
```

{% youtube nV1woOzVvRQ %}
Install an npm module demo
Published: 2021-04-30 15:26:51

@izaacmendes - require() or import depending upon whether you're using ESM modules or CommonJS modules. If you have properly prepared your package.json file to contain your dependent modules, then you can just do npm install with no other arguments in the directory where you package.json is located and npm will fetch all the dependent modules and place them in the node_modules directory. See the --save-xxxx options for NPM for how to save your dependencies to your package.json file if you aren't already doing that. – jfriend00 Aug 7 '20 at 4:42 

mathjs demo
```
npm init -y
npm install mathjs
```
start.js
```javascript
let test = require('mathjs')
let result = test.round(3.12484, 3)               
console.log(result)
```
then run the command in cmd
```
npm run start
```
the output is below
```
PS D:\save\code-rep\feature\npm> npm run start
Debugger attached.

> npm@1.0.0 start D:\save\code-rep\feature\npm
> node start.js

Debugger attached.
3.125
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
PS D:\save\code-rep\feature\npm>
```
The perfect way to check programming language documentation
Tags: programming, documentaion, newlanguage, site
Published: 2021-04-30 15:23:27

Have you ever come across a problem where you forget the syntax of programming language? Whether you are learning a new language or you are experienced this often happens to everyone.
This happens a lot with me I am pretty bad with remembering syntax so I have to get back and forth through google search to search the syntax.
And recently I discovered this website called "http://www.devdocs.io" and it made my work a lot easier. I just have this site opened in the background and it's easy to refer to whenever I am Coding or doing my CodeChef Practice.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5p2ykj97jo55qhyf8erz.PNG)

Let me explain in detail what this site does.
Devdocs.io is the site that contains documentation of all the programming languages its a combination of language cheatsheet and Documentation.
Devdocs.io covers almost 100+ Languages and Libraries.
The devdocs.io documentation contains folders based on various topics and each topic has various concepts in a language, so it is easy to navigate.

Currently, I am learning C++. I have been always using Python and I find C++ difficult. But this time I have to overcome it.

And devdocs.io is been really helping me a lot to check the syntaxes.

I highly recommend you try this site and add it to your bookmark or save it as an app.

Link: https://devdocs.io/
Laravel Firebase Push Notification Example

Published: 2021-04-30 15:13:35

Laravel firebase push notification example. We will learn laravel firebase push notification. In this post, I show example of firebase web push notification.  This tutorial give firebase web push notification in laravel. Today, I show simple way to firebase push notification in laravel.

We will explain step by step laravel firebase push notification example. Also, we will create example of laravel send push notification firebase. In this example, We step by step to send firebase push notification using laravel.

Google provide free open source send web push notification. Also, You learn example of send firebase push notification using laravel. In this example simple to getting device token of logged in users and send web push notification. Also we will create push notification with laravel app.

[https://web-tuts.com/laravel-firebase-push-notification-example/](https://web-tuts.com/laravel-firebase-push-notification-example/)
Laravel Create Directory If Doesn’t Exists Example

Published: 2021-04-30 15:12:44

In this example, you learn laravel create directory if doesn’t exists, how to create folder in storage in laravel, Create folder if does not exists in laravel.

isDirectory() function check if directory exists in laravel application. makeDirectory() function is create directory in laravel application. We will show how to create folder in public folder when folder does not exists.
[https://web-tuts.com/laravel-create-directory-if-doesnt-exists-example/](https://web-tuts.com/laravel-create-directory-if-doesnt-exists-example/)
CodeIgniter Insert Data into Database Example

Published: 2021-04-30 15:11:54

In this example, You learn CodeIgniter insert data into database example, insert user submitted data into the database table, CodeIgniter Database Insert Record.

We will show step by step insert data into database with codeigniter. Also we will show How to insert data into database with CodeIgniter.
[https://web-tuts.com/codeigniter-insert-data-into-database-example/](https://web-tuts.com/codeigniter-insert-data-into-database-example/)
PHP Array Functions With Examples

Published: 2021-04-30 15:11:09

In this post, We will learn PHP Array Functions With Examples. PHP provide more than PHP inbuilt array functions. I will explain step by step array functions with examples in PHP. PHP array functions to you can easy to handle your array in PHP website.

Read also : Laravel Check if key exists in an Array Example

How to Create Array in PHP
In PHP you can create array using array() function.

In PHP, there are three types of arrays:

Indexed arrays – Arrays with a numeric index
Associative arrays – Arrays with named keys
Multidimensional arrays – Arrays containing one or more array

[https://web-tuts.com/php-array-functions-with-example/](https://web-tuts.com/php-array-functions-with-example/)
Delete Data in CodeIgniter Example

Published: 2021-04-30 15:09:10

In this post we learn delete data in CodeIgniter example. we will explain step by step how to delete data from database in CodeIgniter. also i will show delete data from from database using CodeIgniter. you can simply delete data in CodeIgniter using delete() function.

[https://web-tuts.com/delete-data-in-codeigniter-example/](https://web-tuts.com/delete-data-in-codeigniter-example/)
Laravel Dynamic Dependent Select Box using jQuery Ajax

Published: 2021-04-30 15:07:18

In this example we learn Laravel dynamic dependent select box using jQuery Ajax. We will explain step by step dynamic dependent select box in laravel. In this post you learn laravel dynamic dependent select box using jquery ajax.

Some you have need laravel dynamic dependent select box. In this example i will show laravel dynamic dependent country state city select box using jquery ajax.

[https://web-tuts.com/laravel-dynamic-dependent-select-box-using-jquery-ajax/](https://web-tuts.com/laravel-dynamic-dependent-select-box-using-jquery-ajax/)
Razorpay Payment Gateway Integration in Laravel

Published: 2021-04-30 15:05:27

In this post we will learn razorpay payment gateway integration in laravel. i explain simply step by step razorpay integration in laravel. we weill explain laravel razorpay integration.

Razorpay payment gateway is available for india. razorpay provide lot’s of options such as credit card, debit card, phone pay, UPI, google pay, paytm payment option to do payment of user.

This post help for razorpay integration in laravel 6, 7, 8. also i will show razorpay payment integration in laravel.
[https://web-tuts.com/razorpay-payment-gateway-integration-in-laravel/](https://web-tuts.com/razorpay-payment-gateway-integration-in-laravel/)