npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

repackerjs

v1.1.8

Published

Library for getting/cutting/copying Any strings(tags) from original HTML/JS/TS/CSS/SVG documents to any JS-based files and not only

Downloads

22

Readme

RepackerJS - Parse files via NodeJS easly! Tweet

Make file parsing with happy and fun!

npm Price License: MIT GitHub package version

logo_image

Motivation

Every one of use doesn't like to do/repeat routine tasks. Especially in case of a data transferring for a large pack of files. If this is so boring for you too (as for me) this is what you need! With RepackerJS you'll have an opportunity to cut/get any data from the file and insert it inside another one in a few clicks by just CLI command. The most interesting that you can use it for a large pack of the files without recursively! For more info check out the example below, please.

How to use:

1. Grab RepackerJS package from npm by:

       npm install repackerjs -g

----------or

       yarn add repackerjs -g

2. Prepeare your files to parse in some folder:

  • For example: /Users/developer0ne/Desktop/ .

3. Run RepackerJS via CLI:

npm run repackerjs or yarn repackerjs with the next flags {your_upload_path} {insert:your_path_to_file_template} {pattern:some_pattern_for_match} {flags:some_flags_for_match}

Example:

`yarn repackerjs /Users/developer0ne/Desktop/ insert:/Users/developer0ne/project/fileTemplate.ts 'pattern:(<div.*?\/>)|(<span.*?\/>)' flags:im`

RepackerJS Example

Here you can see how easily we can grab some inner data from the large pack of the SVG icons. Then we put founded by regular expression in data from the document by pattern: and flags CLI flags inside new one file. AS you see we made it recursively for all files in the folder without any efforts or tears! It's so easy and fun to use. So what are you waiting for? Enjoy it! :)

API

You can run the parser in a various ways, but I suppose most of all would like to run RepackerJS with custom flags anyway. Currently, it includes constants in case of non-provided during CLI run. Lets see what we can use among all them in CLI:

  • your_upload_path - aka your folder url. It must contain all files to process. Only this one flag is required.
  • insert: - enables custom ability to set template file to process parsed data from ogirinal one.
  • pattern: - allows us to set custom regular expression to process the files data, by cutting data from original in various ways.
  • flags: - custom flags for regular expression that makes all work for us. It's very useful when we need to work with non-regular strings: different string-case, multy-strings, etc.).

FAQ:

  • What flags are reqired during CLI run? -- Only the root path (files folder) is required for parsing. All other flags you can use on your own.