take information from github readme.md [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
https://github.com/octocat/Hello-World
There is a repository, I need to take content from readme.md file.
I've found
https://api.github.com/repos/octocat/Hello-World/readme
but the content is in base64 encoding.
How can i get normal text?

You can convert base64 to content using atob
axios
.get("https://api.github.com/repos/octocat/Hello-World/readme")
.then(({ data: {content} }) => {
console.log(atob(content));
});
console.log(atob("SGVsbG8gV29ybGQhCg==\n"))
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script>

Related

If I am hosting a GitHub repo page and a user pushes data into it, does the data.json file have to be pushed again into the repo? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 days ago.
Improve this question
I am learning about hosting/pushing and pulling data in the server using Node.js.
As per the above question wouldn’t the data.json file need to be pushed into the GitHub repo again for the data to be accessible? Please would somebody with an expert knowledge help me understand how it works?

About the implementation of the MTProtocol [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
source code: https://github.com/morethanwords/tweb
About the implementation of the MTProtocol
I checked the source code, but did not find the socket connection code. Is it implemented in wasm? I need help. Thanks.
i hope to get an answer

Discord.js code doesn't work sending embed messages [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Discord.js code doesn't work sending embed messages
Code embed :
Error code :
This is happening because you are using client#channels#cache#get which is not a valid function since client is not defined in the code block.
You need to use member.guild.channels.cache.get('<id goes here>').send(embed);

How to split up a js file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a problem where I can't upload a js file to GitHub because it is too large. Is there a way to split it into multiple smaller files that still work in the same way?
Instead of splitting the file, use Git LFS
https://git-lfs.github.com/

Base64: How can i convert a URL to base64 format? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i do have question, i have a PDF file fetched in my server which returns a resource location URL, I want to convert it to base64 how do i do that? thank you
I hope this can help you
btoa('www.aws.com/pdf.file') //"d3d3LmF3cy5jb20vcGRmLmZpbGU="

Categories

Resources