Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suretnohq/deno-readfile
Simple Read File as UTF-8 using Deno — Learn Deno
https://github.com/suretnohq/deno-readfile
deno learn-deno
Last synced: 6 days ago
JSON representation
Simple Read File as UTF-8 using Deno — Learn Deno
- Host: GitHub
- URL: https://github.com/suretnohq/deno-readfile
- Owner: SuretnoHQ
- License: mit
- Created: 2018-11-25T12:35:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-07T01:07:00.000Z (almost 5 years ago)
- Last Synced: 2024-10-27T07:51:18.491Z (24 days ago)
- Topics: deno, learn-deno
- Language: TypeScript
- Size: 3.91 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Read File
Simple Read File as UTF-8 using Deno — Learn Deno
> Same as Deno API — readFileSync `export function readFileSync(filename: string): Uint8Array;`
### Usage
Example code, create file **test.ts** and fill with below code.
```ts
import readFile from "https://github.com/muhibbudins/deno-readfile/index.ts";(async () => {
console.log(await readFile("./LICENSE"))
})()
```And then a result will be like this :
```
$ deno test.tsMIT License
Copyright (c) 2018 Muhibbudin Suretno
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```### Related
- [Argument Parser](https://github.com/muhibbudins/deno-arguments)
- [Watcher File](https://github.com/muhibbudins/deno-watcher)
- [Yaml Parser](https://github.com/muhibbudins/deno-yaml)
- [All Topic](https://github.com/topics/learn-deno)### License
This project under MIT License