title
Deno Crash Course

description
In this Deno crash course we will talk about what Deno is and look at some of the basics as well as create a full REST API which starts at 21:54 PART 2: Adding PostgreSQL https://youtu.be/KuaI6mphFNc REST API Code: https://github.com/bradtraversy/deno-rest-api 💖 Become a Patron: Show support & get perks! http://www.patreon.com/traversymedia Website & Udemy Course Links: https://www.traversymedia.com Follow Traversy Media: https://www.twitter.com/traversymedia https://www.instagram.com/traversymedia https://www.facebook.com/traversymedia

detail
{'title': 'Deno Crash Course', 'heatmap': [{'end': 972.773, 'start': 934.848, 'weight': 1}], 'summary': 'Provides a comprehensive overview of deno, highlighting its features such as built-in typescript support, secure by default with sandboxing, and decentralized package management. it covers various aspects including file handling, building a rest api, designing product routes, and creating a fully functional crud rest api using deno and typescript.', 'chapters': [{'end': 362.019, 'segs': [{'end': 65.23, 'src': 'embed', 'start': 43.45, 'weight': 7, 'content': [{'end': 52.362, 'text': "We'll create a simple server and then we'll move on to create a complete REST API using Deno and Oak, which is a minimalistic middleware framework.", 'start': 43.45, 'duration': 8.912}, {'end': 54.845, 'text': 'Similar to Express or Coa.', 'start': 53.003, 'duration': 1.842}, {'end': 58.347, 'text': "So let's talk about what Deno actually is.", 'start': 55.726, 'duration': 2.621}, {'end': 65.23, 'text': "It's a runtime for JavaScript and TypeScript based on the V8 JavaScript engine and the Rust programming language.", 'start': 58.547, 'duration': 6.683}], 'summary': 'Creating a complete rest api using deno and oak, a minimalistic middleware framework.', 'duration': 21.78, 'max_score': 43.45, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM43450.jpg'}, {'end': 205.834, 'src': 'embed', 'start': 141.314, 'weight': 0, 'content': [{'end': 148.119, 'text': "1.0 was just released the other day and it is a good idea to start playing around with it, which is why I'm making this crash course.", 'start': 141.314, 'duration': 6.805}, {'end': 154.463, 'text': "I think that in the future it's going to be big and I think that it's going to be a great alternative to Node.js.", 'start': 148.259, 'duration': 6.204}, {'end': 159.967, 'text': "However, Node.js is not dead, it's not dying, and it's not going anywhere anytime soon.", 'start': 154.844, 'duration': 5.123}, {'end': 163.95, 'text': "It has way too large of an ecosystem and it's way too established.", 'start': 160.367, 'duration': 3.583}, {'end': 168.472, 'text': "So if you're if right now you're in the process of learning Node.js, keep learning it.", 'start': 164.23, 'duration': 4.242}, {'end': 170.974, 'text': 'Do not stop just because Deno was released.', 'start': 168.492, 'duration': 2.482}, {'end': 173.335, 'text': "OK, and that's all I'm going to say about that.", 'start': 171.634, 'duration': 1.701}, {'end': 177.097, 'text': "So let's look at some of the really cool features of Deno.", 'start': 174.295, 'duration': 2.802}, {'end': 182.86, 'text': 'So one, we can use TypeScript and the TypeScript compiler is baked right in.', 'start': 177.177, 'duration': 5.683}, {'end': 188.983, 'text': 'So all you have to do is create a file with a .ts extension and you can then use TypeScript in your code.', 'start': 182.98, 'duration': 6.003}, {'end': 191.588, 'text': 'Then it was also secure by default.', 'start': 189.707, 'duration': 1.881}, {'end': 193.609, 'text': 'It actually runs in a sandbox.', 'start': 191.728, 'duration': 1.881}, {'end': 201.853, 'text': 'And in order to do things like read files, write to files, allow network access or access your environment variables,', 'start': 193.849, 'duration': 8.004}, {'end': 205.834, 'text': 'you actually need to explicitly add these flags when running your application.', 'start': 201.853, 'duration': 3.981}], 'summary': 'Deno 1.0 has just been released with cool features like built-in typescript support and default security measures, while node.js remains strong with a large ecosystem.', 'duration': 64.52, 'max_score': 141.314, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM141314.jpg'}, {'end': 288.711, 'src': 'embed', 'start': 267.692, 'weight': 2, 'content': [{'end': 277.12, 'text': "So we're importing application from and then the dental land URL, slash oak and then the mod ts file, and what happens is, as soon as you import this,", 'start': 267.692, 'duration': 9.428}, {'end': 279.782, 'text': "it's cached to your hard drive on load.", 'start': 277.12, 'duration': 2.662}, {'end': 280.924, 'text': "so it's a little different.", 'start': 279.782, 'duration': 1.142}, {'end': 288.711, 'text': "it might take a little getting used to, but at least you don't have this node modules folder with hundreds or thousands of of folders inside of it.", 'start': 280.924, 'duration': 7.787}], 'summary': 'Importing application from dental land url slashes oak and mod ts file. cached to hard drive on load. no node modules folder clutter.', 'duration': 21.019, 'max_score': 267.692, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM267692.jpg'}], 'start': 7.355, 'title': 'Deno features and its potential impact', 'summary': "Provides an overview of deno, discussing its features, benefits, and the motivation behind its creation. it introduces deno 1.0 as a potential alternative to node.js, highlighting its built-in typescript support, secure by default with sandboxing, and decentralized package management. deno's decentralized package management and modern javascript support are highlighted as key features.", 'chapters': [{'end': 141.314, 'start': 7.355, 'title': 'Deno crash course overview', 'summary': 'Provides an overview of deno, discussing its features, benefits, and the motivation behind its creation, highlighting its differences from node.js and its potential impact on the javascript ecosystem.', 'duration': 133.959, 'highlights': ['Deno is a runtime for JavaScript and TypeScript based on the V8 JavaScript engine and the Rust programming language, created by Ryan Dahl, the creator of Node.js.', "The chapter addresses the misconceptions surrounding Deno's emergence, emphasizing that it is a new technology aiming to address the limitations and shortcomings of Node.js, rather than a complete replacement.", 'The chapter discusses the features and benefits of Deno, including its minimalistic middleware framework, Oak, for building REST APIs, and its support for third-party packages.', "The speaker cautions against sensationalist claims that 'Node.js is dead,' attributing them to content creators seeking views, and emphasizes the need for reasoned evaluation of emerging technologies.", 'The speaker acknowledges that while Deno is a new technology, it is not intended to completely replace Node.js, but rather to provide an alternative addressing the limitations of the existing JavaScript runtime environment.']}, {'end': 362.019, 'start': 141.314, 'title': 'Introduction to deno features', 'summary': "Introduces deno 1.0 as a potential alternative to node.js, highlighting its features including built-in typescript support, secure by default with sandboxing, decentralized package management, and a set of standard library modules, while emphasizing that node.js is still relevant with its large ecosystem. deno's decentralized package management and modern javascript support are highlighted as key features.", 'duration': 220.705, 'highlights': ['Deno offers decentralized package management, allowing importation of third-party packages directly from the Deno.land URL, eliminating the need for a node_modules folder, which was a common complaint in Node.js, leading to hundreds or thousands of folders. This provides a clean and efficient way to manage dependencies.', 'Deno has built-in TypeScript support, making it easy to use TypeScript in code by simply creating a file with a .ts extension, eliminating the need for an external compiler. This streamlines the development process and promotes code consistency and reliability.', 'Deno is secure by default, running in a sandbox and requiring explicit flags for actions like reading or writing files, accessing network, or environment variables. This ensures a secure execution environment, reducing the risk of unauthorized actions or vulnerabilities.', 'Deno includes a set of standard library modules audited by the core team, covering functionalities such as file system operations, date time handling, and HTTP, ensuring compatibility and reliability of these modules with Deno. This simplifies the development process by providing essential functionalities without relying on external packages.', "Deno supports modern JavaScript features, leveraging ES modules and first-class await, taking advantage of the improvements and updates in the language since Node.js's creation in 2009. This promotes the use of modern JavaScript practices for improved code readability and maintainability."]}], 'duration': 354.664, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM7355.jpg', 'highlights': ['Deno offers decentralized package management, eliminating the need for a node_modules folder, providing a clean and efficient way to manage dependencies.', 'Deno has built-in TypeScript support, streamlining the development process and promoting code consistency and reliability.', 'Deno is secure by default, running in a sandbox and requiring explicit flags for actions, reducing the risk of unauthorized actions or vulnerabilities.', 'Deno includes a set of standard library modules audited by the core team, ensuring compatibility and reliability, simplifying the development process.', 'Deno supports modern JavaScript features, promoting the use of modern JavaScript practices for improved code readability and maintainability.', 'Deno is a runtime for JavaScript and TypeScript based on the V8 JavaScript engine and the Rust programming language, created by Ryan Dahl, the creator of Node.js.', 'Deno introduces Oak, a minimalistic middleware framework for building REST APIs, and supports third-party packages.', 'Deno is a new technology aiming to address the limitations and shortcomings of Node.js, providing an alternative rather than a complete replacement.', "The speaker cautions against sensationalist claims that 'Node.js is dead,' emphasizing the need for reasoned evaluation of emerging technologies."]}, {'end': 758.786, 'segs': [{'end': 683.858, 'src': 'embed', 'start': 654.178, 'weight': 8, 'content': [{'end': 658.081, 'text': "we're actually going to get a permissions denied error because, remember,", 'start': 654.178, 'duration': 3.903}, {'end': 663.924, 'text': 'Denno runs in a sandbox and we need to add these flags if we want certain permissions.', 'start': 658.081, 'duration': 5.843}, {'end': 669.467, 'text': 'So this actually requires read permission, file read permission and network permissions.', 'start': 664.424, 'duration': 5.043}, {'end': 673.37, 'text': 'So we have to run it with some flags.', 'start': 670.108, 'duration': 3.262}, {'end': 679.574, 'text': "So after dental run, let's say dash dash allow dash read.", 'start': 673.45, 'duration': 6.124}, {'end': 683.858, 'text': 'and also dash dash allow dash net.', 'start': 680.254, 'duration': 3.604}], 'summary': 'To overcome permissions denied error, denno needs flags for read and network permissions.', 'duration': 29.68, 'max_score': 654.178, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM654178.jpg'}, {'end': 758.786, 'src': 'embed', 'start': 710.93, 'weight': 0, 'content': [{'end': 713.271, 'text': 'Now we can also install this.', 'start': 710.93, 'duration': 2.341}, {'end': 716.671, 'text': 'We just ran it but we can install it with Denno install.', 'start': 713.551, 'duration': 3.12}, {'end': 720.792, 'text': "So I'm going to go back to my terminal control C to get out of that.", 'start': 716.691, 'duration': 4.101}, {'end': 726.254, 'text': "I'm going to run almost the same command except I'm going to do install instead of run.", 'start': 721.273, 'duration': 4.981}, {'end': 729.396, 'text': 'along with the flags, the security flags.', 'start': 727.074, 'duration': 2.322}, {'end': 731.837, 'text': "So what's going to happen is it's going to download.", 'start': 729.956, 'duration': 1.881}, {'end': 734.419, 'text': "It's going to put it in my my base directory.", 'start': 731.877, 'duration': 2.542}, {'end': 736.901, 'text': "What's this? Oh, I already have it.", 'start': 734.86, 'duration': 2.041}, {'end': 738.442, 'text': 'You know what? Let me just.', 'start': 737.221, 'duration': 1.221}, {'end': 741.324, 'text': 'Let me delete it real quick.', 'start': 740.043, 'duration': 1.281}, {'end': 745.087, 'text': "All right, so I'm just going to run that again.", 'start': 743.566, 'duration': 1.521}, {'end': 755.905, 'text': 'And what happens is it stored it in my base directory, which is right here, and then inside a folder called Bin and then File Server, which,', 'start': 748.323, 'duration': 7.582}, {'end': 758.786, 'text': 'if I bring this over you can see this is my home directory.', 'start': 755.905, 'duration': 2.881}], 'summary': 'Installing and running denno, with file stored in base directory.', 'duration': 47.856, 'max_score': 710.93, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM710930.jpg'}], 'start': 362.459, 'title': 'Introduction to deno and its features', 'summary': 'Covers the introduction to deno, its feature of using await in the global scope, built-in testing, browser-compatible api, direct execution of webassembly binaries, installation methods, running deno repl, installing scripts as an executable, upgrading deno, running tests, checking documentation for a module, and using standard library modules like http, log, and fs.', 'chapters': [{'end': 439.282, 'start': 362.459, 'title': 'Introduction to deno', 'summary': 'Introduces deno, highlighting its feature of using await in the global scope without wrapping it in an asynchronous function, built-in testing, browser-compatible api, and direct execution of webassembly binaries. it also covers installation methods using curl, powershell, homebrew, and cargo.', 'duration': 76.823, 'highlights': ['Deno allows the use of await in the global scope without needing to wrap it in an asynchronous function, making it convenient for developers.', 'Built-in testing and browser-compatible API in Deno provide ease of use and compatibility with web development, facilitating efficient development processes.', 'Deno enables the direct execution of WebAssembly binaries, enhancing its performance and capabilities for handling complex tasks.', 'Installation methods for Deno include using curl, powershell, homebrew, and cargo, providing flexibility for developers based on their operating system preferences.']}, {'end': 550.388, 'start': 439.423, 'title': 'Introduction to deno and its features', 'summary': 'Introduces deno as a supplement to a crash course, demonstrating how to open a deno repl, run scripts, install scripts as an executable, upgrade deno, run tests, and check the documentation for a module, while also showcasing standard library modules like http, log, and fs.', 'duration': 110.965, 'highlights': ['Deno REPL allows users to execute JavaScript code and functions similar to the node REPL. The chapter demonstrates the use of Deno REPL to execute JavaScript code and functions, showcasing its similarity to the node REPL.', 'Deno provides various sub commands such as run scripts, install scripts as an executable, upgrade Deno, run tests, check documentation for a module, and bundle modules and dependencies into a single file. The chapter outlines the various sub commands provided by Deno, including running scripts, installing scripts as an executable, upgrading Deno, running tests, checking documentation for a module, and bundling modules and dependencies into a single file.', 'Standard library modules like HTTP, log, and FS are available in Deno for users to utilize. The chapter highlights the availability of standard library modules such as HTTP, log, and FS in Deno, providing users with essential functionalities.']}, {'end': 758.786, 'start': 550.869, 'title': 'Introduction to deno web server', 'summary': 'Introduces the deno web server, demonstrating how to run scripts from urls, execute file server, and install scripts with permissions for file read and network access, showcasing the use of deno.', 'duration': 207.917, 'highlights': ["The chapter demonstrates running scripts from URLs with Deno, showing how to execute welcome.ts and colors.ts, producing 'Welcome to Deno' and 'hello world' outputs respectively. 2 scripts executed", 'It showcases the use of Deno to execute a file server, which requires permissions for file read and network access, and demonstrates accessing the server through a browser, displaying the files in the folder. File server executed with permissions for file read and network access', "The chapter also illustrates installing scripts with Deno using 'deno install' command, storing the downloaded files in the base directory and Bin folder. Script installed with 'deno install' command"]}], 'duration': 396.327, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM362459.jpg', 'highlights': ['Deno allows the use of await in the global scope without needing to wrap it in an asynchronous function, making it convenient for developers.', 'Built-in testing and browser-compatible API in Deno provide ease of use and compatibility with web development, facilitating efficient development processes.', 'Deno enables the direct execution of WebAssembly binaries, enhancing its performance and capabilities for handling complex tasks.', 'Installation methods for Deno include using curl, powershell, homebrew, and cargo, providing flexibility for developers based on their operating system preferences.', 'Deno REPL allows users to execute JavaScript code and functions similar to the node REPL.', 'Deno provides various sub commands such as run scripts, install scripts as an executable, upgrade Deno, run tests, check documentation for a module, and bundle modules and dependencies into a single file.', 'Standard library modules like HTTP, log, and FS are available in Deno for users to utilize.', "The chapter demonstrates running scripts from URLs with Deno, showing how to execute welcome.ts and colors.ts, producing 'Welcome to Deno' and 'hello world' outputs respectively.", 'It showcases the use of Deno to execute a file server, which requires permissions for file read and network access, and demonstrates accessing the server through a browser, displaying the files in the folder.', "The chapter also illustrates installing scripts with Deno using 'deno install' command, storing the downloaded files in the base directory and Bin folder."]}, {'end': 1065.508, 'segs': [{'end': 905.241, 'src': 'embed', 'start': 873.057, 'weight': 0, 'content': [{'end': 885.386, 'text': "So I'm going to create another file here called date time dot t s and remember we want to import import from.", 'start': 873.057, 'duration': 12.329}, {'end': 893.272, 'text': "And then what I'll do is go back to standard library here and under date time you'll see this mod t s.", 'start': 885.726, 'duration': 7.546}, {'end': 897.475, 'text': 'So this is the date time module and I can actually just grab the URL from here.', 'start': 893.272, 'duration': 4.203}, {'end': 905.241, 'text': "and then we want that in quotes and I'm going to import two things.", 'start': 899.252, 'duration': 5.989}], 'summary': "Creating a new file 'date time.ts' and importing modules from the standard library.", 'duration': 32.184, 'max_score': 873.057, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM873057.jpg'}, {'end': 979.458, 'src': 'heatmap', 'start': 931.727, 'weight': 2, 'content': [{'end': 934.828, 'text': "So I've already used this, so it's already cached to my system.", 'start': 931.727, 'duration': 3.101}, {'end': 940.689, 'text': "So I'm not seeing that line, but I'm going to go ahead and use the day of year.", 'start': 934.848, 'duration': 5.841}, {'end': 945.245, 'text': 'console log that and then this takes in a date.', 'start': 942.824, 'duration': 2.421}, {'end': 946.565, 'text': "So we'll say new date.", 'start': 945.445, 'duration': 1.12}, {'end': 951.467, 'text': "Let's do say 20 20 dash 0 2 0 2.", 'start': 946.626, 'duration': 4.841}, {'end': 953.688, 'text': "So it'll just give us whatever the day is of that.", 'start': 951.467, 'duration': 2.221}, {'end': 964.227, 'text': "And then let's do another console log with the current day of year, which will just give me whatever today is the day of of today's date.", 'start': 954.189, 'duration': 10.038}, {'end': 968.73, 'text': "So I'll go down here and I'll run Denno run date time.", 'start': 964.668, 'duration': 4.062}, {'end': 972.773, 'text': 'Yes, I get 32 for this and I get 140 for this.', 'start': 968.811, 'duration': 3.962}, {'end': 979.458, 'text': "OK, so that's just an example of how you can use a standard standard library module.", 'start': 972.793, 'duration': 6.665}], 'summary': 'Demonstrated use of date functions to retrieve day of year, obtaining 32 and 140 as results.', 'duration': 47.731, 'max_score': 931.727, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM931727.jpg'}, {'end': 1007.497, 'src': 'embed', 'start': 980.379, 'weight': 5, 'content': [{'end': 987.564, 'text': 'Now we also have the demo namespace where we have different methods and things we can use.', 'start': 980.379, 'duration': 7.185}, {'end': 991.586, 'text': "So I'm going to close both of those up and create a new file here.", 'start': 987.624, 'duration': 3.962}, {'end': 995.809, 'text': "Let's call this create file dot T.S.", 'start': 992.147, 'duration': 3.662}, {'end': 1000.912, 'text': 'and I just want this script to create a file called greet dot text.', 'start': 996.249, 'duration': 4.663}, {'end': 1007.497, 'text': "So first thing I'll do is create an encoder so we can use UTF-8 encoding so we can say new,", 'start': 1001.433, 'duration': 6.064}], 'summary': "Demo namespace with methods for creating a file 'greet.text' using utf-8 encoding.", 'duration': 27.118, 'max_score': 980.379, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM980379.jpg'}], 'start': 759.246, 'title': 'Deno, typescript, and the deno standard library', 'summary': 'Provides an introduction to deno and typescript, highlighting the use of deno commands and the advantages of typescript. it also covers the utilization of the deno standard library for module importing, extensions, caching, and file manipulation.', 'chapters': [{'end': 873.037, 'start': 759.246, 'title': 'Introduction to deno and typescript', 'summary': "Introduces deno and typescript, demonstrating the use of deno commands like 'run' and 'install', and the compilation of typescript files, highlighting the advantages of using typescript and its error-checking capabilities with deno.", 'duration': 113.791, 'highlights': ["Deno commands like 'run' and 'install' are demonstrated, showcasing their use for running local servers and installing scripts.", 'The advantages of using TypeScript are highlighted, emphasizing its ability to catch errors during compilation and its flexibility for adding TypeScript to JavaScript files.', 'The process of creating a file in VS code and running it with Deno is explained, demonstrating the compilation of TypeScript files and the immediate feedback on errors.']}, {'end': 1065.508, 'start': 873.057, 'title': 'Using deno standard library', 'summary': 'Explains how to use the deno standard library to import modules, install extensions, cache modules, use standard library modules, and the deno namespace. it also demonstrates creating and writing to a file using deno standard library methods.', 'duration': 192.451, 'highlights': ["Importing and using standard library modules The chapter explains how to import and use the date time module from the Deno standard library, demonstrating the use of 'dayOfYear' and 'currentDayOfYear' methods to obtain specific day information.", 'Installing Deno extension for VSCode It is mentioned that installing the Deno extension for VSCode is necessary to resolve squiggly lines under URLs and to ensure proper caching of modules.', "Using the Deno namespace and methods The chapter highlights the usage of the Deno namespace, demonstrating the creation of a file and writing text to it using the 'Deno.writeTextFile' method, along with the asynchronous 'await' feature."]}], 'duration': 306.262, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM759246.jpg', 'highlights': ['The advantages of using TypeScript are highlighted, emphasizing its ability to catch errors during compilation and its flexibility for adding TypeScript to JavaScript files.', "Deno commands like 'run' and 'install' are demonstrated, showcasing their use for running local servers and installing scripts.", 'The process of creating a file in VS code and running it with Deno is explained, demonstrating the compilation of TypeScript files and the immediate feedback on errors.', "Importing and using standard library modules The chapter explains how to import and use the date time module from the Deno standard library, demonstrating the use of 'dayOfYear' and 'currentDayOfYear' methods to obtain specific day information.", "Using the Deno namespace and methods The chapter highlights the usage of the Deno namespace, demonstrating the creation of a file and writing text to it using the 'Deno.writeTextFile' method, along with the asynchronous 'await' feature.", 'Installing Deno extension for VSCode It is mentioned that installing the Deno extension for VSCode is necessary to resolve squiggly lines under URLs and to ensure proper caching of modules.']}, {'end': 1427.162, 'segs': [{'end': 1096.82, 'src': 'embed', 'start': 1066.088, 'weight': 1, 'content': [{'end': 1068.369, 'text': "So here let's pass in a file name.", 'start': 1066.088, 'duration': 2.281}, {'end': 1070.849, 'text': "We'll call it greet dot txt.", 'start': 1068.409, 'duration': 2.44}, {'end': 1074.911, 'text': 'And then the content is going to be the great text like that.', 'start': 1071.009, 'duration': 3.902}, {'end': 1081.333, 'text': "OK, so now we'll go ahead and we'll run Denno run and then create file.", 'start': 1074.931, 'duration': 6.402}, {'end': 1092.697, 'text': "And notice I'm getting an error here because I need to add the allow right flag because we're writing to a file which might be a pain in the ass at first,", 'start': 1083.49, 'duration': 9.207}, {'end': 1093.697, 'text': 'until you get used to it.', 'start': 1092.697, 'duration': 1}, {'end': 1096.82, 'text': 'But I mean it makes it more secure overall.', 'start': 1093.777, 'duration': 3.043}], 'summary': 'Using denno to create file greet.txt with great content, encountering error due to missing allow right flag.', 'duration': 30.732, 'max_score': 1066.088, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM1066088.jpg'}, {'end': 1216.335, 'src': 'embed', 'start': 1184.751, 'weight': 0, 'content': [{'end': 1186.352, 'text': "Let's try that again.", 'start': 1184.751, 'duration': 1.601}, {'end': 1187.513, 'text': 'And there we go.', 'start': 1186.372, 'duration': 1.141}, {'end': 1188.373, 'text': 'Hello world.', 'start': 1187.713, 'duration': 0.66}, {'end': 1189.374, 'text': 'My name is Brad.', 'start': 1188.673, 'duration': 0.701}, {'end': 1195.406, 'text': 'Now, the last thing I want to do before we start our rest API is just create a very simple server.', 'start': 1191.024, 'duration': 4.382}, {'end': 1199.728, 'text': "So I'm going to call this simple server dot TS.", 'start': 1195.426, 'duration': 4.302}, {'end': 1204.39, 'text': "And I'm sure that you've seen this example over and over and over in other videos.", 'start': 1200.488, 'duration': 3.902}, {'end': 1212.453, 'text': "So what I'm going to do is just go to the docs here, go to the standard library, HTTP and right here.", 'start': 1204.47, 'duration': 7.983}, {'end': 1216.335, 'text': "So I'm sure you've seen this block of code and articles and videos and all that.", 'start': 1212.473, 'duration': 3.862}], 'summary': 'Brad creates a simple server in typescript for rest api, following standard http library example.', 'duration': 31.584, 'max_score': 1184.751, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM1184751.jpg'}], 'start': 1066.088, 'title': 'Deno file handling and building a rest api', 'summary': 'Demonstrates file handling in deno, emphasizing security measures, and covers creating a rest api using the oak framework, including setting up the server, router, and running it on port 5000.', 'chapters': [{'end': 1184.731, 'start': 1066.088, 'title': 'File handling in deno', 'summary': "Demonstrates how to create and read a file using deno, emphasizing the need to use the 'allow-write' flag for writing to a file for security purposes.", 'duration': 118.643, 'highlights': ["The chapter emphasizes the need to add the 'allow-write' flag when writing to a file in Deno for security purposes, despite initial inconvenience, it's considered worth it for overall security.", "Demonstrates the process of creating a file in Deno by running 'Deno run' and encountering an error due to the absence of the 'allow-write' flag.", "Illustrates the process of reading a file in Deno using 'Deno.open' and 'Deno.copy' to output the file content to standard output."]}, {'end': 1427.162, 'start': 1184.751, 'title': 'Building a deno rest api', 'summary': 'Covers creating a simple server in deno and setting up a basic api using the oak framework, demonstrating the use of await syntax, initializing the app, and setting up the router, with an example of running the server on port 5000.', 'duration': 242.411, 'highlights': ["Creating a simple server in Deno The chapter begins with creating a simple server in Deno by using the standard library HTTP and serving a 'hello world' response on port 8000.", 'Setting up a basic API with Oak framework The chapter proceeds to demonstrate setting up a basic API using the Oak framework, initializing the app and setting up the router, with an example of running the server on port 5000.', 'Demonstrating the use of await syntax The use of await syntax is showcased when getting the request object and adding a response to the server, allowing for asynchronous handling of requests.']}], 'duration': 361.074, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM1066088.jpg', 'highlights': ["The chapter emphasizes the need to add the 'allow-write' flag when writing to a file in Deno for security purposes, despite initial inconvenience, it's considered worth it for overall security.", 'Setting up a basic API with Oak framework The chapter proceeds to demonstrate setting up a basic API using the Oak framework, initializing the app and setting up the router, with an example of running the server on port 5000.', "Demonstrates the process of creating a file in Deno by running 'Deno run' and encountering an error due to the absence of the 'allow-write' flag.", "Creating a simple server in Deno The chapter begins with creating a simple server in Deno by using the standard library HTTP and serving a 'hello world' response on port 8000."]}, {'end': 2624.547, 'segs': [{'end': 1714.632, 'src': 'embed', 'start': 1690.405, 'weight': 1, 'content': [{'end': 1699.868, 'text': 'and define the fields which will be an ID which is a string a name which is a string description.', 'start': 1690.405, 'duration': 9.463}, {'end': 1704.609, 'text': 'And then we have the price which is going to be a number.', 'start': 1701.908, 'duration': 2.701}, {'end': 1712.251, 'text': "OK so that's the interface and we can apply this to our array here by setting it to product but it is an array.", 'start': 1704.629, 'duration': 7.622}, {'end': 1714.632, 'text': 'So we just want to add in our brackets here.', 'start': 1712.311, 'duration': 2.321}], 'summary': 'Defining fields id, name, description, and price for interface. applying to array as product.', 'duration': 24.227, 'max_score': 1690.405, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM1690405.jpg'}, {'end': 1914.605, 'src': 'embed', 'start': 1886.1, 'weight': 2, 'content': [{'end': 1890.962, 'text': 'True And in our data, we have an array of all of our products, which is exactly what we want.', 'start': 1886.1, 'duration': 4.862}, {'end': 1901.244, 'text': "Now, I'm going to go ahead and just create all of our functions here and export them because I have a tendency to to forget to do all that stuff.", 'start': 1892.322, 'duration': 8.922}, {'end': 1903.865, 'text': "So let's copy this.", 'start': 1902.384, 'duration': 1.481}, {'end': 1910.343, 'text': "And let's paste this in and then I'll just get rid of everything that's actually in here in the body.", 'start': 1905.74, 'duration': 4.603}, {'end': 1914.605, 'text': 'So this this function is going to be to get a single product.', 'start': 1910.883, 'duration': 3.722}], 'summary': 'Creating functions to manage array of products data.', 'duration': 28.505, 'max_score': 1886.1, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM1886100.jpg'}, {'end': 2259.441, 'src': 'embed', 'start': 2227.942, 'weight': 0, 'content': [{'end': 2236.306, 'text': "OK, so whatever this is has to be formatted as a product, which we created the interface for or undefined if it's not found.", 'start': 2227.942, 'duration': 8.364}, {'end': 2240.368, 'text': "Now, down here, let's have an if statement.", 'start': 2237.327, 'duration': 3.041}, {'end': 2246.671, 'text': "Let's say if the product is found because I mean, they might put an ID that's that's not there.", 'start': 2240.408, 'duration': 6.263}, {'end': 2255.676, 'text': "If it's found, then we'll set the response status to 200 and we'll set the response dot body.", 'start': 2247.732, 'duration': 7.944}, {'end': 2259.441, 'text': 'to an object with success.', 'start': 2257.04, 'duration': 2.401}], 'summary': 'Create product interface with success response if found.', 'duration': 31.499, 'max_score': 2227.942, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM2227942.jpg'}, {'end': 2418.453, 'src': 'embed', 'start': 2385.058, 'weight': 3, 'content': [{'end': 2388.099, 'text': 'So we do have to add a sink here like that.', 'start': 2385.058, 'duration': 3.041}, {'end': 2400.101, 'text': "Now I want to just make sure that there's data sent with the body so we can say if not request which has a method called has body.", 'start': 2389.591, 'duration': 10.51}, {'end': 2409.91, 'text': "So if it hasn't body data this will be true but we're checking to see if it's false if it's false then let's go ahead and send a response status.", 'start': 2400.902, 'duration': 9.008}, {'end': 2418.453, 'text': "of 404, which means that they haven't formatted the data correctly or given us what we want to get a correct response.", 'start': 2411.09, 'duration': 7.363}], 'summary': 'Adding a sink and checking for body data before sending a 404 response.', 'duration': 33.395, 'max_score': 2385.058, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM2385058.jpg'}], 'start': 1427.182, 'title': 'Designing product routes and functions', 'summary': 'Covers the process of setting up router and middleware, creating apis with deno & typescript, and designing product routes and functions, including adding, updating, and deleting products, and managing product data in javascript, integrating detailed explanations and examples.', 'chapters': [{'end': 1502.083, 'start': 1427.182, 'title': 'Setting up router and middleware', 'summary': 'Explains the process of setting up a router and middleware in deno, including initializing a router, adding middleware for routes, and creating the first route for a get request to the url of api/version1/products.', 'duration': 74.901, 'highlights': ["Initializing a router by creating a new instance of the router class and assigning it to the variable 'router'.", "Adding middleware using 'app.use' to handle routes and allowing all methods for the routes.", 'Creating the first route for a get request to the URL of API/version1/products using the initialized router.']}, {'end': 1910.343, 'start': 1502.961, 'title': 'Creating apis with deno & typescript', 'summary': 'Demonstrates how to create apis using deno and typescript, covering the process of setting up routes, structuring files, creating interfaces, and implementing controller functions with detailed explanations and examples.', 'duration': 407.382, 'highlights': ['The chapter demonstrates how to create APIs using Deno and TypeScript. The chapter provides instructions on using Deno and TypeScript to create APIs, showcasing a practical approach to building web APIs.', 'Covering the process of setting up routes, structuring files, creating interfaces, and implementing controller functions. The tutorial covers the essential steps of setting up routes, structuring files, creating interfaces, and implementing controller functions, offering a comprehensive guide to building APIs with Deno and TypeScript.', 'The function get products is created to fetch all products with metadata and route details. The tutorial demonstrates the creation of a function called get products, providing metadata on the purpose of the function and the associated route, showcasing a clear and structured approach to implementing controller functions.']}, {'end': 2140.375, 'start': 1910.883, 'title': 'Designing product routes and functions', 'summary': 'Discusses creating routes for getting, adding, updating, and deleting a product, and testing these routes to ensure functionality before proceeding to the logic implementation.', 'duration': 229.492, 'highlights': ['The chapter covers creating routes for get, add, update, and delete functions for a single product, ensuring that the routes work before proceeding to logic implementation.', 'The functions include get product, add product, update product, and delete product, with corresponding HTTP request methods such as get, post, put, and delete.', "The testing of the routes involves checking if the functions are being called by making requests to the routes using different HTTP methods and parameter values, ensuring the routes' functionality before focusing on the logic implementation.", 'The importance of testing the routes for get, add, update, and delete functions is emphasized, as it ensures that the functions are invoked correctly before moving to the implementation of the actual logic.']}, {'end': 2624.547, 'start': 2141.096, 'title': 'Managing product data in javascript', 'summary': 'Covers handling product data in a javascript application, including retrieving a single product by id, adding a new product to the array, and returning appropriate responses based on the request. it demonstrates using pure javascript functions to handle static data, validating data sent from the client, and generating unique ids for new products using the uuid standard library.', 'duration': 483.451, 'highlights': ['The chapter demonstrates retrieving a single product by ID and handling responses, with examples of success and failure scenarios, showcasing the functionality of the application. (relevance: 5)', 'It explains the process of adding a new product to the array, including data validation, creating a unique ID using the UUID standard library, and returning the newly created product in the response. (relevance: 4)', "The transcript provides insights into using pure JavaScript functions to handle static data, showcasing the application's ability to perform operations without relying on a database. (relevance: 3)"]}], 'duration': 1197.365, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM1427182.jpg', 'highlights': ['The chapter covers creating routes for get, add, update, and delete functions for a single product, ensuring that the routes work before proceeding to logic implementation.', 'The chapter demonstrates how to create APIs using Deno and TypeScript, providing a practical approach to building web APIs.', "Initializing a router by creating a new instance of the router class and assigning it to the variable 'router'.", 'The chapter demonstrates retrieving a single product by ID and handling responses, with examples of success and failure scenarios.', "Adding middleware using 'app.use' to handle routes and allowing all methods for the routes."]}, {'end': 3124.305, 'segs': [{'end': 2686.001, 'src': 'embed', 'start': 2625.447, 'weight': 0, 'content': [{'end': 2628.369, 'text': "Well, I'm just putting an object adjacent object with a name.", 'start': 2625.447, 'duration': 2.922}, {'end': 2631.27, 'text': "We'll say product for.", 'start': 2628.389, 'duration': 2.881}, {'end': 2642.994, 'text': 'Description This is product for and price.', 'start': 2635.111, 'duration': 7.883}, {'end': 2646.956, 'text': 'Nineteen ninety nine.', 'start': 2645.896, 'duration': 1.06}, {'end': 2647.456, 'text': 'All right.', 'start': 2647.176, 'duration': 0.28}, {'end': 2651.838, 'text': "So we'll go ahead and send that and we get back to a one created success.", 'start': 2647.516, 'duration': 4.322}, {'end': 2654.92, 'text': 'True And we get back to the product we created.', 'start': 2651.938, 'duration': 2.982}, {'end': 2658.841, 'text': 'And you can see the ID, the UID was generated and put there as well.', 'start': 2654.94, 'duration': 3.901}, {'end': 2664.044, 'text': 'And then if we go back to this tab and send again, you can see that product four is added.', 'start': 2659.502, 'duration': 4.542}, {'end': 2665.465, 'text': 'All right.', 'start': 2665.165, 'duration': 0.3}, {'end': 2667.167, 'text': "So we're now able to add a product.", 'start': 2665.485, 'duration': 1.682}, {'end': 2670.709, 'text': "Now, if I restart the server, it's going to disappear because it's only in memory.", 'start': 2667.207, 'duration': 3.502}, {'end': 2672.971, 'text': "It's not saved in a database.", 'start': 2671.59, 'duration': 1.381}, {'end': 2676.113, 'text': "So now let's do the update.", 'start': 2674.152, 'duration': 1.961}, {'end': 2679.456, 'text': "So with the update, we're going to need.", 'start': 2677.674, 'duration': 1.782}, {'end': 2682.498, 'text': "We're going to need params.", 'start': 2679.476, 'duration': 3.022}, {'end': 2686.001, 'text': "We're going to need a request and response.", 'start': 2683.098, 'duration': 2.903}], 'summary': 'Adding product succeeded with id generated, but not saved in database.', 'duration': 60.554, 'max_score': 2625.447, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM2625447.jpg'}], 'start': 2625.447, 'title': 'Product management and crud rest api', 'summary': 'Covers adding and updating products with name, description, and price, along with the implementation of a fully functional crud rest api using deno, demonstrating the usage of map and filter functions, and achieving a fully functional crud rest api.', 'chapters': [{'end': 2789.343, 'start': 2625.447, 'title': 'Product management and update process', 'summary': 'Discusses adding a product with a name, description, and price, receiving a success response, and then updating the product details using params, request, and response in the server, with the updated data formatted as an object with an optional name, description, and price.', 'duration': 163.896, 'highlights': ['The chapter explains the process of adding a product with a name, description, and price, receiving a success response, and being able to view the created product with its generated ID, demonstrating the successful creation of a product.', 'It also demonstrates the process of updating the product details using params, request, and response in the server, where the updated data is formatted as an object with an optional name, description, and price.']}, {'end': 3124.305, 'start': 2789.763, 'title': 'Crud rest api with deno', 'summary': 'Covers the implementation of a fully functional crud rest api using deno, including the usage of map and filter functions, updating and deleting products, and the response status codes, with a demonstration of updating and deleting products, achieving a fully functional crud rest api.', 'duration': 334.542, 'highlights': ['The implementation of a fully functional CRUD REST API using Deno, including the usage of map and filter functions, updating and deleting products, and the response status codes, with a demonstration of updating and deleting products, achieving a fully functional CRUD REST API.', 'Demonstration of updating a product by sending a PUT request with the updated data, resulting in the product being updated and reflected in the response, showcasing the functionality of updating products through the API.', 'Illustration of deleting a product by sending a DELETE request with the product ID, resulting in the specified product being removed from the array and confirming the deletion through the response, showcasing the functionality of deleting products through the API.']}], 'duration': 498.858, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/NHHhiqwcfRM/pics/NHHhiqwcfRM2625447.jpg', 'highlights': ['Demonstration of updating a product by sending a PUT request with the updated data, resulting in the product being updated and reflected in the response, showcasing the functionality of updating products through the API.', 'Illustration of deleting a product by sending a DELETE request with the product ID, resulting in the specified product being removed from the array and confirming the deletion through the response, showcasing the functionality of deleting products through the API.', 'The chapter explains the process of adding a product with a name, description, and price, receiving a success response, and being able to view the created product with its generated ID, demonstrating the successful creation of a product.', 'It also demonstrates the process of updating the product details using params, request, and response in the server, where the updated data is formatted as an object with an optional name, description, and price.']}], 'highlights': ['Deno offers decentralized package management, eliminating the need for a node_modules folder, providing a clean and efficient way to manage dependencies.', 'Deno has built-in TypeScript support, streamlining the development process and promoting code consistency and reliability.', 'Deno is secure by default, running in a sandbox and requiring explicit flags for actions, reducing the risk of unauthorized actions or vulnerabilities.', 'Deno includes a set of standard library modules audited by the core team, ensuring compatibility and reliability, simplifying the development process.', 'Deno supports modern JavaScript features, promoting the use of modern JavaScript practices for improved code readability and maintainability.', 'Deno allows the use of await in the global scope without needing to wrap it in an asynchronous function, making it convenient for developers.', 'Built-in testing and browser-compatible API in Deno provide ease of use and compatibility with web development, facilitating efficient development processes.', 'Deno enables the direct execution of WebAssembly binaries, enhancing its performance and capabilities for handling complex tasks.', 'Installation methods for Deno include using curl, powershell, homebrew, and cargo, providing flexibility for developers based on their operating system preferences.', 'Deno REPL allows users to execute JavaScript code and functions similar to the node REPL.', 'The advantages of using TypeScript are highlighted, emphasizing its ability to catch errors during compilation and its flexibility for adding TypeScript to JavaScript files.', 'The chapter covers creating routes for get, add, update, and delete functions for a single product, ensuring that the routes work before proceeding to logic implementation.', 'Demonstration of updating a product by sending a PUT request with the updated data, resulting in the product being updated and reflected in the response, showcasing the functionality of updating products through the API.', 'Illustration of deleting a product by sending a DELETE request with the product ID, resulting in the specified product being removed from the array and confirming the deletion through the response, showcasing the functionality of deleting products through the API.', 'The chapter explains the process of adding a product with a name, description, and price, receiving a success response, and being able to view the created product with its generated ID, demonstrating the successful creation of a product.']}