Gathering detailed insights and metrics for @nasfald/tagify
Gathering detailed insights and metrics for @nasfald/tagify
Gathering detailed insights and metrics for @nasfald/tagify
Gathering detailed insights and metrics for @nasfald/tagify
npm install @nasfald/tagify
Typescript
Module System
Node Version
NPM Version
HTML (55.14%)
JavaScript (35.28%)
CSS (9.58%)
Total Downloads
572
Last Day
2
Last Week
2
Last Month
7
Last Year
46
69 Commits
2 Watching
1 Branches
1 Contributors
Latest Version
1.2.2
Package Id
@nasfald/tagify@1.2.2
Size
61.98 kB
NPM Version
4.2.0
Node Version
7.10.0
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
0%
2
Compared to previous week
Last month
250%
7
Compared to previous month
Last year
-44.6%
46
Compared to previous year
Want to simply convert an input field into a tags element, in a easy customizable way, with good performance and smallest code footprint? You are in the right place my friend.
hellip
by giving max-width
to the tag
element in your CSS
Simply run gulp
in your terminal, from the project's path (Gulp should be installed first)
Lets say this is your markup, and you already have a value set on the input (which was pre-filled by data from the server):
1<input name='tags' placeholder='write some tags' value='foo, bar,buzz'> 2<textarea name='tags' placeholder='write some tags'>foo, bar,buzz</textarea>
what you need to do to convert that nice input into "tags" is simply select your input/textarea and run tagify()
:
1// vanilla component 2var input = document.querySelector('input[name=tags]'), 3 tagify = new Tagify( input ); 4 5// with settings passed 6tagify = new Tagify( input, { 7 duplicates: true, 8 whitelist: ['foo', 'bar'], 9 callbacks: { 10 add : onAddTag // calls an imaginary "onAddTag" function when a tag is added 11 } 12}); 13 14// listen to custom tags' events such as 'add' or 'remove' 15tagify1.on('remove', ()=>{ 16 console.log(e, e.detail); 17});
1$('[name=tags]') 2 .tagify() 3 .on('add', function(e, tagName){ 4 console.log('added', tagName) 5 });
Now markup be like:
1<tags> 2 <tag> 3 <x></x> 4 <div><span title="css">css</span></div> 5 </tag> 6 <tag> 7 <x></x> 8 <div><span title="html">html</span></div> 9 </tag> 10 <tag> 11 <x></x> 12 <div><span title="javascript">javascript</span></div> 13 </tag> 14 <div> 15 <input list="tagsSuggestions3l9nbieyr" class="input placeholder"> 16 <datalist id="tagsSuggestions3l9nbieyr"> 17 <label> select from the list: 18 <select> 19 <option value=""></option> 20 <option>foo</option> 21 <option>bar</option> 22 </select> 23 </label> 24 </datalist><span>write some tags</span> 25 </div> 26 <input name="tags" placeholder="write some tags" value="foo, bar,buzz"> 27</tags>
Name | Info |
---|---|
destroy | if called, will revert the input back as it was before Tagify was applied |
removeAllTags | removes all tags and rests the original input tag's value property |
Name | Info |
---|---|
add | A tag has been added |
remove | A tag has been removed |
duplicate | A tag has been added and found to be a duplicate of existing one |
maxTagsExceed | Number of tags exceeds the allowed quantity and the exceed tags were denied (removed) |
blacklisted | A tag which is in the blacklist has been added and denied (removed) |
notWhitelisted | A tag which is not in the whitelist has been added and denied (removed) |
Name | Type | Default | Info |
---|---|---|---|
delimiters | String | "," | [regex] split tags by any of these delimiters. Example: Space or Coma - ", " |
pattern | String | "" | Validate the input by REGEX pattern (can also be applied on the input itself as an attribute) |
duplicates | Boolean | false | (flag) should duplicate tags be allowed or not |
enforeWhitelist | Boolean | false | should ONLY use tags allowed in whitelist |
autocomplete | Boolean | true | show native suggeestions list, as you type |
whitelist | Array | [] | an array of tags which only they are allowed |
blacklist | Array | [] | an array of tags which aren't allowed |
callbacks | Object | {} | exposed callbacks object to be triggered on events: 'add' / 'remove' tags |
maxTags | Number | Infinity | max number of tags |
suggestionsMinChars | Number | 2 | minimum characters to input which shows the sugegstions list |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More