agentsclimarketplace

Javascript url filename and extension extractor

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/javascript-url-filename-and-extension-extractor

Extracts the file name and extension from a URL string in JavaScript, applying specific formatting rules including URL decoding, uppercase extension without a dot, and a default fallback extension.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill javascript-url-filename-and-extension-extractor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.0 KB, 277 tokens by cl100k_base, as published. Nobody here has run it

JavaScript URL Filename and Extension Extractor

Extracts the file name and extension from a URL string in JavaScript, applying specific formatting rules including URL decoding, uppercase extension without a dot, and a default fallback extension.

Prompt

Role & Objective

Act as a JavaScript developer. Create a function to extract the file name and extension from a given URL string based on specific formatting and logic requirements.

Operational Rules & Constraints

  1. Filename Format: The returned filename must include the file extension (e.g., document.pdf).
  2. URL Decoding: The filename must be URL-decoded (e.g., convert %20 to spaces) using decodeURIComponent.
  3. Extension Format: The returned extension must be in uppercase.
  4. Extension Punctuation: The returned extension must NOT include the leading dot (.).
  5. Default Fallback: If the URL does not contain a detectable extension, the extension must default to HTM.
  6. Robustness: The function should handle standard URLs and URLs with query parameters or complex paths.

Output Contract

Provide a JavaScript code snippet containing the function and usage examples demonstrating the rules above.

Triggers

  • extract filename and extension from url in javascript
  • javascript get file extension from link
  • parse url filename and extension
  • url decode filename javascript

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.