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

brlinker

v1.0.2

Published

File link system One change made everywhere

Downloads

3

Readme

brLinker

brLinker It helps you to call files inside html or php so that you can easily change them from one place and also provide you with the ability to collect javascript or css files or any type of files into one file in the order you need the best thing in this is it so fast and its best for low performance

Installation

Use npm to install brLinker.

npm install brlinker

Usage

Javascipt

const brLinker = require('brLinker');
//import brLinker
//pages that you created 
console.log(brLinker.pages); //you can also define your pages here [object]
//options default true at all
brLinker.options = {
   pretty : true // export a pretty html or php file syntax
   watchDirs : true // watch new files in watching dirs 
}

//build a page TASKS
let pageName = brLinker.newPage('pageName',  page=> {
     //set page settings
     page.data = {}//data for including components in the page
     page.src('sourceFile.(php/html)', 'outputFile.(php/html)')
     page.compress('taskName(css/js ...)',
                  ['file1', 'file2', ...] ,
                   'outputFile.(js/css ...)')
})
//run page tasks 
pageName.export() // run export task [src]
pageName.runTask('taskName'); //run compress task BY its name
pageName.runAll() // run all page tasks 
pageName.dataFrom('jsonFilePath'); //get data from a json file

//run all page tasks 
brLinker.runExports() //run all export tasks in All pages
brLinker.runTask('taskName') //run All taks that has this Name i all pages
/* important : your must define this task name in All pages*/
brLinker.OMEGArun() // run all tasks in all pages


//watching tasks 

brLinker.watch('taskName' , PATHS , callbackFunction)
//how to create PATHS to watch


`
   ------------    paths type -------------

  normal path: 'C://dir1/dir2/myfile.html'
-------------------------------------------
  all folder : 'C://dir1/**/myfile.html'
     this mean watch mayfile.html in all folders in dir1
----------------------------------------------
  all file have the same extension : 'C://dir1/*.js'
     this mean watch all files that have .js extension
------------------------------------------------
  exemple : 'C://dir1/**/*.js' 
     this mean all files .js in all folders in /dir1 

`
//PATHS can be a string[one path] or an array[many paths]
 

html /php

normal import


how to import a template html or php
<linker tem="path-of-your-template">
how to import a template many times
<for-linker for="int-number" tem="path-of-your-template">

import with data

This data will come from the page data that was previously defined in JavaScript

in The Template

 <head>
     <title>{d:title}</title>
</head>
 
{d:varName} //set data by this varName

in the soucePage


how to import a template html or php
<linker tem="path-of-your-template" data="head">
how to import a template many times
<for-linker for="multiTitles" tem="path-of-your-template">
multiTitles must be an ARRAY just like you do in for loop

in the json File or JS object

(The data that you entered for the page jsFile:[page.data / dataFrom()])

{
  "head": {
       "title": "home page or any title "
    }, 
   "multiTitles" : [
         {
       "title": "home page or any title 1"
         },{
       "title": "home page or any title 2"
         },{
       "title": "home page or any title 3"
        },{
       "title": "home page or any title 4"
        }
    ]
}

OUTPUT

 <head>
     <title>home page or any title </title>
</head>
 <head>
     <title>home page or any title 1</title>
</head>
 <head>
     <title>home page or any title 2</title>
</head>
 <head>
     <title>home page or any title 3</title>
</head>
 <head>
     <title>home page or any title 4</title>
</head>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

email : [email protected]

License

MIT